Skip to content

chore: implement task heartbeat#909

Open
chaen wants to merge 2 commits intoDIRACGrid:mainfrom
chaen:task_heartbit
Open

chore: implement task heartbeat#909
chaen wants to merge 2 commits intoDIRACGrid:mainfrom
chaen:task_heartbit

Conversation

@chaen
Copy link
Copy Markdown
Contributor

@chaen chaen commented May 5, 2026

closes #908

renew Redis stream message ownership during worker execution

Add a worker heartbeat so long-running tasks are not reclaimed by
XAUTOCLAIM while they are still running. ReceivedMessage now carries
both ack() and renew() callbacks, with renew implemented via XCLAIM
to reset the pending idle timer for the current consumer. The worker
starts this heartbeat for broker-delivered messages and stops it when
execution finishes. Interactive execution is unchanged.

chaen added 2 commits May 5, 2026 16:31
Add a worker heartbeat so long-running tasks are not reclaimed by
XAUTOCLAIM while they are still running. ReceivedMessage now carries
both ack() and renew() callbacks, with renew implemented via XCLAIM
to reset the pending idle timer for the current consumer. The worker
starts this heartbeat for broker-delivered messages and stops it when
execution finishes. Interactive execution is unchanged.
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 diracx | 🛠️ Build #32545686 | 📁 Comparing 4f597f0 against latest (9f4828c)

  🔍 Preview build  

3 files changed
± dev/explanations/tasks/index.html
± dev/reference/tasks/index.html
± dev/explanations/tasks/class-details/index.html

@chaen chaen changed the title chore: Implement task heartbeat chore: implement task heartbeat May 5, 2026


async def _message_heartbeat(
renew: Callable[[], Any],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
renew: Callable[[], Any],
renew: Callable[[], Awaitable[None]],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Long running tasks end up being scheduled multiple times

2 participants