Skip to content

Conversation

@budde
Copy link
Contributor

@budde budde commented Jun 29, 2021

Avoid arithmetic overflow for mailboxCount metric

Motivation:

It seems that something can cause a mailbox to close with its processedActivations count greater than the incoming message count for the run that resulted in the mailbox close. In this scenario, an arithmetic overflow occurs when trying to record the final mailboxCount metric.

Modifications:

Only record the mailboxCount metric if the processedActivations count is less than or equal to the message count. Record a warn log otherwise.

Result:

Comment on lines 497 to 498
"status": "\(status)",
"processedActivations": "\(processedActivations)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if the extra metadata is necessary or not (or if the formatting is appropriate) but figured the more info the better

Copy link
Member

Choose a reason for hiding this comment

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

Yeah always good to have more info here, thanks!

@ktoso ktoso merged commit a9a120e into apple:main Jun 29, 2021
@ktoso ktoso deleted the mailbox-metric-overflow branch June 29, 2021 23:06
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.

Arithmetic overflow when recording mailboxCount metric during shutdown

2 participants