← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:librarian-client-socket-timeout-disable into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:librarian-client-socket-timeout-disable into launchpad:master.

Commit message:
Temporarily disable librarian.client_socket_timeout

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1998616 in Launchpad itself: "Translation download not working"
  https://bugs.launchpad.net/launchpad/+bug/1998616

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/435283

For some reason this timeout is causing the translation export script to fail to upload exported files to the librarian much more often than usual.  I'd still like to track this down properly so that we can get the robustness improvement from this timeout, but it isn't worth causing major user-visible issues for that.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:librarian-client-socket-timeout-disable into launchpad:master.
diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
index 89ba7bd..db9893c 100644
--- a/lib/lp/services/config/schema-lazr.conf
+++ b/lib/lp/services/config/schema-lazr.conf
@@ -1264,8 +1264,10 @@ authentication_timeout: 5
 # The timeout in seconds for librarian client socket operations.  Note that
 # this is deliberately generous: it's intended as a backstop to ensure that
 # scripts don't get stuck waiting forever in the event of network outages.
+# Temporarily disabled since it causes
+# https://bugs.launchpad.net/launchpad/+bug/1998616.
 # datatype: integer
-client_socket_timeout: 900
+client_socket_timeout: none
 
 
 [librarian_gc]
diff --git a/lib/lp/services/librarian/client.py b/lib/lp/services/librarian/client.py
index 80ce5c6..ddf1117 100644
--- a/lib/lp/services/librarian/client.py
+++ b/lib/lp/services/librarian/client.py
@@ -83,7 +83,8 @@ class FileUploadClient:
         """
         try:
             self.state.s = socket.socket(AF_INET, SOCK_STREAM)
-            self.state.s.settimeout(config.librarian.client_socket_timeout)
+            if config.librarian.client_socket_timeout is not None:
+                self.state.s.settimeout(config.librarian.client_socket_timeout)
             self.state.s.connect((self.upload_host, self.upload_port))
             self.state.f = self.state.s.makefile("rwb", 0)