Skip to content

Fix LogsCheckpoint thread blocking shutdown#6787

Merged
bentsherman merged 2 commits intomasterfrom
fix/logs-checkpoint-interrupt
Feb 2, 2026
Merged

Fix LogsCheckpoint thread blocking shutdown#6787
bentsherman merged 2 commits intomasterfrom
fix/logs-checkpoint-interrupt

Conversation

@pditommaso
Copy link
Member

Summary

  • Fix checkpoint thread blocking shutdown for up to 90 seconds
  • Use interrupt() to wake the thread from sleep immediately
  • Remove unused terminated field since interrupt flag is sufficient

Problem

The tower-logs-checkpoint thread sleeps for the configured interval (default 90s). When onFlowComplete() was called, it set terminated=true but the thread was stuck in Thread.sleep(), causing the main thread to wait up to 90 seconds before shutdown could complete.

Solution

Call thread.interrupt() before thread.join() to wake the thread immediately from sleep. The await() method already handles InterruptedException correctly.

🤖 Generated with Claude Code

The checkpoint thread sleeps for the configured interval (default 90s).
When onFlowComplete() was called, it waited for the sleep to complete
before the thread could exit.

Now interrupt() is called to wake the thread immediately from sleep,
allowing the main thread to continue shutdown without delay.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@netlify
Copy link

netlify bot commented Jan 31, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 6f22a2b
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6980c79bf65b1a00080ebf0a

@bentsherman bentsherman merged commit 54a5958 into master Feb 2, 2026
23 checks passed
@bentsherman bentsherman deleted the fix/logs-checkpoint-interrupt branch February 2, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants