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

feat(workers): add Worker.get_worker_id [NET-523] #1771

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Aug 25, 2023

Description

Provide a non-throwing method to get worker peer id.

Motivation

We often call Worker.get_peer_id on decider spell to check whether or not a worker exists, but this method throws an error in the absence of a worker, which pollutes nox logs:

2023-08-16T17:34:28.579229Z  WARN tokio ThreadId(09) aquamarine::particle_functions: Failed host call "worker" "create" ["0x254fb741db88469b152d30f09396779d02cb7be6"] (146us 875ns): "Error: Worker for 0x254fb741db88469b152d30f09396779d02cb7be6 already exists\nWorkerAlreadyExists { deal_id: \"0x254fb741db88469b152d30f09396779d02cb7be6\" }" particle_id="spell_86b9e58f-0385-4247-a8a1-84e8ae546b58_1"

Proposed Changes

Implement Worker.get_worker_id:

service Worker:
  get_worker_id(deal_id: ?string) -> ?PeerId

Worker.get_peer_id will be deprecated soon.

Checklist

  • The code follows the project's coding conventions and style guidelines.
  • All tests related to the changes have passed successfully.
  • Documentation has been updated to reflect the changes (if applicable).
  • All new and existing unit tests have passed.
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Code has been reviewed for quality and adherence to guidelines.
  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

@linear
Copy link

linear bot commented Aug 25, 2023

NET-523 Add Worker.get_peer_id_opt

look at decider PR and maybe reconsider

sorcerer/src/sorcerer.rs Outdated Show resolved Hide resolved
@justprosh justprosh requested a review from folex August 30, 2023 10:28
@justprosh justprosh changed the title feat(workers): add Worker.get_peer_id_opt [NET-523] feat(workers): add Worker.get_worker_id [NET-523] Aug 30, 2023
@justprosh justprosh enabled auto-merge (squash) August 31, 2023 08:45
@justprosh justprosh merged commit a45cf79 into master Aug 31, 2023
14 checks passed
@justprosh justprosh deleted the worker_get_peer_id_opt branch August 31, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants