Repository navigation
Don't log web's Squid warm-up request as a failure - #73
Merged
Merged
Conversation
Web warms up every new tunnel with GET http://127.0.0.1:1/squid-internal-tunnel-warmup through both Squid ports, to absorb the cold-start 502 before a customer's first request does. Port 1 is refused, so each answers 502 here, and under the default --log-http errors that printed two WARNING blocks with headers on every start, which read as a failed tunnel. HttpLogHandler now leaves /squid-internal requests out in errors mode, as TunnelProxyHandler already does for its own failure line. url and headers still log them, since those modes asked for every request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every tunnel start prints two warnings like this, which a customer reads as a broken tunnel:
They come from web:
DynamicTunnel.warm_up_tunnel_proxysends that request through both Squid ports (2009, 2011) to absorb Squid's cold-start 502 before the customer's first request does. Port 1 is always refused, so the 502 is by design. Web's comment says thesquid-internalpath "keeps the tunnel client from logging a warning for it". That was true ofTunnelProxyHandler's own failure line, butHttpLogHandler(added for--log-http, TB-319) logs every failed request in the defaulterrorsmode, so the warning came back.Change
HttpLogHandlerleaves out requests whose path starts with/squid-internal, inerrorsmode only.urlandheadersasked for every request, so they still log them.Tests
HttpLoggingTest:errors_staysQuietForSquidsWarmupRequestfails without the change;url_stillLogsSquidsWarmupRequestchecks thaturlmode still logs it.mvn verify: 1055 tests, 0 failures.