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

Better out of capacity error #1711

Merged
merged 2 commits into from
May 3, 2022
Merged

Better out of capacity error #1711

merged 2 commits into from
May 3, 2022

Conversation

asonnino
Copy link
Contributor

@asonnino asonnino commented May 2, 2022

Better out-of-capacity error message for consensus adapter

@asonnino asonnino self-assigned this May 2, 2022
@asonnino asonnino requested a review from LefKok May 2, 2022 16:14
@asonnino asonnino enabled auto-merge (squash) May 2, 2022 16:15
self.pending.entry(digest).or_insert_with(Vec::new).push(replier);
} else if replier.send(Err(SuiError::ListenerCapacityExceeded)).is_err() {
debug!("No replier to listen to consensus output {digest}");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a debug or a warn?

Do we have an issue / comment to track the recovery logic, and which side is involved (Narwhal, Sui ...).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try to never allow bad clients to make us log warns (only bad does)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the recovery logic will have to be the retries of the client

Copy link
Contributor

Choose a reason for hiding this comment

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

A way to do this orthogonally to the log level is to set up a span, with context on what's going on. That would allow us to filter what's going on:

// Enable Trace Propagation across spans/processes using tx_digest
let span = tracing::debug_span!(
"process_tx",
?tx_digest,
tx_kind = transaction.data.kind_as_str()
);

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement!

self.pending.entry(digest).or_insert_with(Vec::new).push(replier);
} else if replier.send(Err(SuiError::ListenerCapacityExceeded)).is_err() {
debug!("No replier to listen to consensus output {digest}");
Copy link
Contributor

Choose a reason for hiding this comment

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

A way to do this orthogonally to the log level is to set up a span, with context on what's going on. That would allow us to filter what's going on:

// Enable Trace Propagation across spans/processes using tx_digest
let span = tracing::debug_span!(
"process_tx",
?tx_digest,
tx_kind = transaction.data.kind_as_str()
);

@asonnino asonnino merged commit 300f32d into main May 3, 2022
@asonnino asonnino deleted the better-error branch May 3, 2022 15:47
longbowlu pushed a commit that referenced this pull request May 12, 2022
punwai pushed a commit that referenced this pull request Jul 27, 2022
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.

2 participants