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

Exit when worker detects expired client, remove event decoding trace #1023

Merged
merged 6 commits into from
Jun 1, 2021

Conversation

ancazamfir
Copy link
Collaborator

@ancazamfir ancazamfir commented May 31, 2021

Closes: #1022

Description

While debugging an issue on akashnet, noticed that client workers don't exit when states are expired.
Also the trace for undecoded events is still super annoying so let's remove it.


For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

Copy link
Member

@adizere adizere left a comment

Choose a reason for hiding this comment

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

Left one question/suggestion, which is not critical. But otherwise looks good.

@@ -56,7 +56,7 @@ impl ClientWorker {
// Run client refresh, exit only if expired or frozen
if let Err(e @ ForeignClientError::ExpiredOrFrozen(..)) = client.refresh() {
error!("failed to refresh client '{}': {}", client, e);
continue;
return Err(Box::new(e));
Copy link
Member

Choose a reason for hiding this comment

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

Just a thought: Would it make more sense to return with an Ok(()) here? I think it might be less confusing for the caller if we distinguish between returning with an Error (in which case the worker could retry for specific error), and returning with Ok (in this case the worker finished its job).

Suggested change
return Err(Box::new(e));
return Ok(());

Copy link
Member

@romac romac Jun 1, 2021

Choose a reason for hiding this comment

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

Yeah I think return Ok is fine, as we already print the error before exiting (though perhaps it should be a warning then?)

Copy link
Member

Choose a reason for hiding this comment

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

@adizere adizere merged commit e4a6543 into master Jun 1, 2021
@adizere adizere deleted the anca/akash_debug_fixes branch June 1, 2021 13:12
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
…nformalsystems#1023)

* Exit when worker detects expired client, remove event decoding trace

* Provide worker's name when worker aborts

* Exit client worker without error when client is expired or frozen

* Remove unused import

* Changelog

Co-authored-by: Romain Ruetschi <romain@informal.systems>
Co-authored-by: Adi Seredinschi <adi@informal.systems>
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.

Refresh doesn't abort on expired or frozen client
3 participants