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

Use Unchanging Identifiers for Worker Processes #308

Conversation

bencap
Copy link
Collaborator

@bencap bencap commented Sep 30, 2024

Previously, worker jobs used score set URNs to identify resources on which they should operate. Due to the nature of these async jobs and the fact that URNs can change on score set publication, this was a poor choice for processes that might defer execution until a moment in time after the resource identifier had changed.

This commit updates worker processes to operate on internal database identifiers to identify the resources on which they should work. This should protect us from instances where the URN changes and the worker process no longer can access the resource on which it was spawned.

Previously, worker jobs used score set URNs to identify resources on which they should operate.
Due to the nature of these async jobs and the fact that URNs can change on score set publication,
this was a poor choice for processes that might defer execution until a moment in time after the
resource identifier had changed.

This commit updates worker processes to operate on internal database identifiers to identify the
resources on which they should work. This should protect us from instances where the URN changes
and the worker process no longer can access the resource on which it was spawned.
Providing a score set to the mapping manager implied it was managing the passed score set,
when it was really managing the head of the mapping queue. Eliminates that argument to the
manager to make the function signature more idiomatic to the job purpose.
@bencap bencap added the type: bug Something isn't working label Sep 30, 2024
@bencap bencap linked an issue Sep 30, 2024 that may be closed by this pull request
@bencap bencap added app: worker Task implementation touches the worker app: backend Task implementation touches the backend labels Oct 2, 2024
Copy link
Contributor

@sallybg sallybg left a comment

Choose a reason for hiding this comment

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

This looks great! I like that this removes the score set argument to the variant mapper manager, it's much cleaner this way.
We talked about this offline but putting it here for visibility: If the score set is published after the mapping job starts, the job will fail because the mapper returns mapped variants associated with variant urns, and changing the score set urn also changes the variant urns. It's fine that this scenario causes the mapping to fail; the mapping job will be retried, so it will download the new variant urns upon retry and the job should then succeed.

@bencap bencap merged commit ef00e39 into release-2024.4.1 Oct 9, 2024
4 checks passed
@bencap bencap deleted the bugfix/bencap/301/use-unchanging-identifiers-for-async-jobs branch October 9, 2024 18:09
@bencap bencap mentioned this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: backend Task implementation touches the backend app: worker Task implementation touches the worker type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publishing a Score Set will Invalidate Mapping URN
2 participants