Skip to content

Conversation

@LexLuthr
Copy link
Contributor

@LexLuthr LexLuthr commented Jan 9, 2026

This PR fixes a couple of problem.

  1. Notify task is a very important step for piece processing but it was an IAMBored scheduled. PDP nodes are a lot more noisy due to PPInit and PPNext failures and this caused harmony scheduler to no prioritize Notify for scheduling. I have moved scheduling to a goroutine.
  2. Order of Notify is before Proving task. This means when people run this PR and they have huge backlog of Notify tasks, they will fail to prove on time. This PR fixes the problem.

Outside of PR's scope:

  1. Rethink Curio's IAmBored at scale. Especially on PDP nodes.
  2. Get rid of DataSet Init from Curio and keep this in FWSS and PDPVerifier layer.

@LexLuthr LexLuthr requested a review from a team as a code owner January 9, 2026 21:20
@BigLep BigLep requested a review from Copilot January 9, 2026 21:27
@BigLep BigLep requested a review from rvagg January 9, 2026 21:28
Copy link
Contributor

Copilot AI left a 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`)
Copy link
Member

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.

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.

3 participants