Skip to content

Make DN delister synchronous with indexer - #6315

Closed
michellebrier wants to merge 3 commits into
mainfrom
mbrier/proto-1343/tn-try-again
Closed

Make DN delister synchronous with indexer#6315
michellebrier wants to merge 3 commits into
mainfrom
mbrier/proto-1343/tn-try-again

Conversation

@michellebrier

Copy link
Copy Markdown
Contributor

Description

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

"update_delist_statuses",
kwargs={"current_block_timestamp": next_block["timestamp"]},
)
).get(timeout=1)

@michellebriermichellebrierOct 12, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

task executes async but this simulates a synchronous execution: it waits 1s for the task to complete, if it does not, it raises an exception (caught below). the actual task isn't terminated
https://docs.celeryq.dev/en/latest/reference/celery.result.html#celery.result.AsyncResult.get

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

however will have to adjust the batch size to fetch from trusted notifier each iteration and this timeout to be reasonably on par



@celery.task(name="update_delist_statuses", bind=True)
@celery.task(name="update_delist_statuses", bind=True, soft_time_limit=1, time_limit=2)

@michellebriermichellebrierOct 12, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

caps the task at a 1s time limit, 2s hard limit.
the soft_time_limit raises a SoftTimeLimitExceeded exception after 1s, which gets caught and subsequently the finally clause releases any locks held.
the time_limit hard-kills the task. the lock has a timeout set so if it happens to not get released properly in this case, it wont block future tasks forever

@isaacsoloisaacsolo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looks good as long as update_delist_statuses can run within 1s

@michellebrier
michellebrierforce-pushed the mbrier/proto-1343/tn-try-again branch from 6e4c8c5 to ca9c3a9CompareDecember 2, 2023 03:57
@michellebrier
michellebrier marked this pull request as ready for review December 2, 2023 03:59
@audius-infra

Copy link
Copy Markdown
Collaborator

@michellebrier

Copy link
Copy Markdown
ContributorAuthor

closing in favor of #6832 - a better soln

@raymondjacobson
raymondjacobson deleted the mbrier/proto-1343/tn-try-again branch December 18, 2025 21:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@michellebrier@audius-infra@isaacsolo