Skip to content
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

workers: job-types, state: applicator: emit task completion events #874

Merged
merged 2 commits into from
Dec 21, 2024

Conversation

akirillo
Copy link
Contributor

@akirillo akirillo commented Dec 21, 2024

This PR introduces a TaskCompletion event type, representing the completion of a task (successful or not). This will be used to index task history, and as such it is basically a wrapper around the HistoricalTask type. This event gets emitted in the state applicator in the same code path where we record historical tasks. As such, we check that the local peer is the executor of the task before emitting the event, to prevent duplicate event emission across the cluster.

Testing

  • All unit tests pass (though, with that said, it looks like the new order metadata index tests put each other in deadlock)
  • Tested w/ local relayer & event export sidecar, manually inspected events received in SQS to ensure there were no issues in transmission

@akirillo akirillo added the enhancement New feature or request label Dec 21, 2024
@akirillo akirillo requested a review from joeykraut December 21, 2024 23:10
@akirillo akirillo self-assigned this Dec 21, 2024
Copy link
Member

@joeykraut joeykraut left a comment

Choose a reason for hiding this comment

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

looks good, don't think the ApplicatorQueues type is useful code though

state/src/applicator/mod.rs Outdated Show resolved Hide resolved
state/src/applicator/task_queue.rs Show resolved Hide resolved
@akirillo akirillo force-pushed the andrew/task-completion-event branch from 9999769 to 23b6fe8 Compare December 21, 2024 23:30
@akirillo akirillo force-pushed the andrew/task-completion-event branch from 23b6fe8 to 0766185 Compare December 21, 2024 23:33
@akirillo akirillo merged commit e8a7442 into main Dec 21, 2024
2 of 3 checks passed
@akirillo akirillo deleted the andrew/task-completion-event branch December 21, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants