[Bug] Worker intermittently stops polling after synchronous activity completion
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず、ThreadPoolExecutor と長時間実行される同期 Activity を使用して、設定済みの Worker を再現します。次に、CompleteActivity RPC が成功した直後からポーリングを追跡します。完了条件は、完了後も Worker がポーリングリクエストを発行し続け、再接続のために 5~15 分待機しないことです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Worker intermittently stops polling after completing long-running synchronous activities. The gRPC connection appears to drop after activity completion, but the worker process remains
alive. Auto-reconnection eventually works (5-15 minutes later), but causes delays in activity processing.
Environment
- temporalio version: 1.18.1
- grpcio version: 1.75.1
- Python version: 3.11
- Temporal Server: Running in Docker (localhost:7233)
- OS: Ubuntu Linux
Worker Configuration
with concurrent.futures.ThreadPoolExecutor(max_workers=60) as executor:
worker = Worker(
client,
task_queue="core-py",
max_concurrent_activities=60,
activities=[...],
workflows=[],
activity_executor=executor,
graceful_shutdown_timeout=timedelta(seconds=300),
)
await worker.run()
Activity Characteristics
- Type: Synchronous (runs on ThreadPoolExecutor)
- Duration: 30 minutes to 3 hours
- Timeout: 36,000 seconds (10 hours)
- Heartbeat: Disabled (0s)
Observed Behavior
┌──────┬───────────────────────────────────────────────────┐
│ Step │ What Happens │
├──────┼───────────────────────────────────────────────────┤
│ 1 │ Worker polls, receives activity │
├──────┼───────────────────────────────────────────────────┤
│ 2 │ Activity executes (30 min - 3 hrs) │
├──────┼───────────────────────────────────────────────────┤
│ 3 │ Activity completes, CompleteActivity RPC succeeds │
├──────┼───────────────────────────────────────────────────┤
│ 4 │ Worker stops polling - no new poll requests │
├──────┼───────────────────────────────────────────────────┤
│ 5 │ Server logs "task queue closed" after 5 min │
├──────┼───────────────────────────────────────────────────┤
│ 6 │ Worker auto-reconnects after 5-15 min │
└──────┴───────────────────────────────────────────────────┘
Evidence
Queue closes exactly 5 min after activity completion:
┌────────────────────┬──────────────┐
│ Activity Completed │ Queue Closed │
├────────────────────┼──────────────┤
│ 08:02:39 │ 08:07:39 │
├────────────────────┼──────────────┤
│ 08:57:38 │ 09:02:38 │
├────────────────────┼──────────────┤
│ 09:46:46 │ 09:51:46 │
└────────────────────┴──────────────┘
During stuck period:
- Process alive, 45 threads active
- DB connections work
- No TCP connection to port 7233
Key Observations
1. Intermittent - not every completion triggers it
2. No duration correlation - 27 min to 168 min activities affected
3. Auto-recovery works - just slow (5-15 min)
4. Completion succeeds - only polling stops afterward
Suspected Cause
Race condition in SDK's handling of synchronous activity completion. After ThreadPoolExecutor returns result and CompleteActivity RPC succeeds, polling doesn't resume properly.
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 241
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 49
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
temporalio/sdk-python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
temporalio/sdk-python#1517 · コメント 10 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
temporalio/sdk-python#496 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
temporalio/sdk-python#1894 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
temporalio/sdk-python#1890 ·
-
[Bug] Local activity resolutions regrouped on replay since 1.32.0, delivering the wrong payload オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
temporalio/sdk-python#1881 · コメント 1 件 ·
temporalio/sdk-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·