launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30733
[Merge] ~cjwatson/launchpad:mirror-prober-silence-tunnel-errors into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:mirror-prober-silence-tunnel-errors into launchpad:master.
Commit message:
Silence TunnelError OOPSes from the mirror prober
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/455903
These are expected in normal operation (since proxied `CONNECT` requests to remote hosts might fail for all sorts of reasons), and they're very noisy in OOPS reports.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:mirror-prober-silence-tunnel-errors into launchpad:master.
diff --git a/lib/lp/registry/scripts/distributionmirror_prober.py b/lib/lp/registry/scripts/distributionmirror_prober.py
index f2fa888..9dd2cf2 100644
--- a/lib/lp/registry/scripts/distributionmirror_prober.py
+++ b/lib/lp/registry/scripts/distributionmirror_prober.py
@@ -41,7 +41,7 @@ from lp.registry.interfaces.distributionmirror import (
)
from lp.registry.interfaces.distroseries import IDistroSeries
from lp.services.config import config
-from lp.services.httpproxy.connect_tunneling import TunnelingAgent
+from lp.services.httpproxy.connect_tunneling import TunnelError, TunnelingAgent
from lp.services.librarian.interfaces import ILibraryFileAliasSet
from lp.services.timeout import urlfetch
from lp.services.webapp import canonical_url
@@ -661,6 +661,7 @@ class ArchiveMirrorProberCallbacks(LoggingMixin):
ConnectionSkipped,
InvalidHTTPSCertificate,
InvalidHTTPSCertificateSkipped,
+ TunnelError,
)
def __init__(
@@ -834,6 +835,7 @@ class MirrorCDImageProberCallbacks(LoggingMixin):
UnknownURLSchemeAfterRedirect,
InvalidHTTPSCertificate,
InvalidHTTPSCertificateSkipped,
+ TunnelError,
)
def __init__(self, mirror, distroseries, flavour, log_file):
diff --git a/lib/lp/registry/tests/test_distributionmirror_prober.py b/lib/lp/registry/tests/test_distributionmirror_prober.py
index 244d05c..aed0097 100644
--- a/lib/lp/registry/tests/test_distributionmirror_prober.py
+++ b/lib/lp/registry/tests/test_distributionmirror_prober.py
@@ -77,7 +77,7 @@ from lp.registry.tests.distributionmirror_http_server import (
from lp.services.config import config
from lp.services.daemons.tachandler import TacTestSetup
from lp.services.database.interfaces import IStore
-from lp.services.httpproxy.connect_tunneling import TunnelingAgent
+from lp.services.httpproxy.connect_tunneling import TunnelError, TunnelingAgent
from lp.services.timeout import default_timeout
from lp.testing import (
TestCase,
@@ -985,6 +985,7 @@ class TestMirrorCDImageProberCallbacks(TestCaseWithFactory):
UnknownURLSchemeAfterRedirect,
InvalidHTTPSCertificate,
InvalidHTTPSCertificateSkipped,
+ TunnelError,
},
)
exceptions = [
@@ -995,6 +996,7 @@ class TestMirrorCDImageProberCallbacks(TestCaseWithFactory):
UnknownURLSchemeAfterRedirect("https://localhost"),
InvalidHTTPSCertificate("localhost", 443),
InvalidHTTPSCertificateSkipped("https://localhost/xx"),
+ TunnelError("Could not open CONNECT tunnel."),
]
for exception in exceptions:
failure = callbacks.ensureOrDeleteMirrorCDImageSeries(
diff --git a/lib/lp/services/httpproxy/connect_tunneling.py b/lib/lp/services/httpproxy/connect_tunneling.py
index c94548c..c2f945c 100644
--- a/lib/lp/services/httpproxy/connect_tunneling.py
+++ b/lib/lp/services/httpproxy/connect_tunneling.py
@@ -7,6 +7,7 @@ See https://twistedmatrix.com/trac/ticket/8806 (and reference
implementation at https://github.com/scrapy/scrapy/pull/397/files)."""
__all__ = [
+ "TunnelError",
"TunnelingAgent",
]