Skip to content

Commit 6287b8c

Browse files
committed
fix: use longer timeout for initial public-inbox clone (CM-1318)
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent 9a86494 commit 6287b8c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

services/apps/mailing_list_integration/src/crowdmail/services/mirror/mirror_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919
from crowdmail.logger import logger
2020
from crowdmail.services.parse.noteren import get_email_from_git, git_run_command
21-
from crowdmail.settings import LORE_MIRROR_DIR
21+
from crowdmail.settings import CLONE_TIMEOUT_SEC, LORE_MIRROR_DIR
2222

2323
RETRYABLE_MIRROR_ERRORS = (NetworkError, RateLimitError, RemoteServerError)
2424

@@ -108,7 +108,9 @@ async def ensure_mirror(list_name: str, source_url: str, mirror_dir: str = LORE_
108108
clone_url = source_url.rstrip("/") + "/"
109109
logger.info(f"Cloning lore list '{list_name}' from {clone_url} into {list_dir}")
110110
os.makedirs(os.path.dirname(list_dir), exist_ok=True)
111-
await _run_shell_command(["public-inbox-clone", "-q", clone_url, list_dir])
111+
await _run_shell_command(
112+
["public-inbox-clone", "-q", clone_url, list_dir], timeout=CLONE_TIMEOUT_SEC
113+
)
112114
# public-inbox-clone drops a manifest scoped to clone time; remove it
113115
# and re-fetch from inside list_dir so the manifest is regenerated
114116
# correctly there (needed to detect new epoch shards, e.g. git/1.git,

services/apps/mailing_list_integration/src/crowdmail/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ def load_env_var(key: str, required=True, default=None):
4646
# messages instead of buffering an entire list's history in memory before one
4747
# flush at the end — large lore archives can have 100k+ messages.
4848
ACTIVITY_FLUSH_BATCH_SIZE = int(load_env_var("ACTIVITY_FLUSH_BATCH_SIZE", default="500"))
49+
50+
# Initial public-inbox-clone of a large archive (e.g. linux-kernel) can legitimately
51+
# take much longer than the default command timeout; incremental fetches stay short.
52+
CLONE_TIMEOUT_SEC = int(load_env_var("CLONE_TIMEOUT_SEC", default="3600"))

0 commit comments

Comments
 (0)