-
Notifications
You must be signed in to change notification settings - Fork 41
fix: notify task scheduling #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pdpv0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes notify task scheduling issues in the PDP (Proof of Data Possession) system by moving task scheduling from an IAmBored callback to a dedicated goroutine and adjusting task execution order to prioritize proving over notification.
Key changes:
- Replaces IAmBored-based scheduling with a continuous polling goroutine for notify tasks
- Reorders task registration to execute proving tasks before notify tasks, preventing notification backlogs from blocking proof submissions
- Adds exponential retry backoff to init and next proving period tasks
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tasks/pdp/notify_task.go | Refactored from IAmBored scheduling to goroutine-based polling; added Promise pattern for task function management; removed LIMIT 1 from query to process all pending uploads |
| cmd/curio/tasks/tasks.go | Reordered task registration to place pdpProveTask before pdpNotifTask |
| tasks/pdp/task_init_pp.go | Added exponential retry wait with 5s initial delay and factor of 2 |
| tasks/pdp/task_next_pp.go | Added exponential retry wait with 5s initial delay and factor of 2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WHERE | ||
| pu.piece_ref IS NOT NULL | ||
| AND pp.complete = TRUE | ||
| AND pu.notify_task_id IS NULL LIMIT 10`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add AND pu.notify_url IS NOT "" too?
We don't use notify in Synapse, there may be more advanced FWSS users who are using it, perhaps with their own interaction model, but I'm not aware of them. Maybe this task running every time is more of a problem since it doesn't have a URL to do anything with.
This PR fixes a couple of problem.
Outside of PR's scope: