Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Improve warning about notifications queue and remove spurious triggers #5512

Merged
merged 5 commits into from
Apr 3, 2020

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Apr 3, 2020

Supercedes #5500

Improves the logging for the queue being full, and fixes the fact that the warning is being printed when we fail to immediately flush the queue.
We now only push the element, and flushing is handled by the poll function.
This is how this code was originally intended to behave, and the fact that we were immediately trying to flush the queue was not intended.

We also now report the queue size to Prometheus even when it's full.

@tomaka tomaka added the A0-please_review Pull request needs code review. label Apr 3, 2020
@tomaka tomaka requested a review from mxinden April 3, 2020 09:35
Copy link
Contributor

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Great catch!

This looks good to me.

);
}
if let Some(metric) = &self.queue_size_report {
metric.observe(substream.queue_len() as f64);
Copy link
Contributor

Choose a reason for hiding this comment

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

In regards to observing even though the message is dropped: If we only observe when the message was actually sent, the histogram count metric would tell us how many messages went into the channel. Later on we could add an additional metric (a simple counter) to count the messages being dropped. What do you think @tomaka? Would that enable us to deeper understand the behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

Totally fine if you see this more as a hack than a useful feature.

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 way I see it, dropping messages is something that is really not supposed to happen, and knowing how many messages are dropped isn't necessarily useful, as we have to treat 1 dropped message the same as 500 dropped messages.

Additionally #5481 would consist in reworking this code anyway.

@tomaka tomaka merged commit 62a6d9e into paritytech:master Apr 3, 2020
@tomaka tomaka deleted the fix-notifs-warning branch April 3, 2020 12:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants