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

[release/5.0] Handle Counter Polling Interval of 0 #54035

Merged
merged 5 commits into from
Jun 15, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 10, 2021

Backport of #53836 to release/5.0

/cc @hoyosjs @josalem

Customer Impact

When listening to EventCounters there is a dedicated thread that is supposed to publish the metric values via EventSource on a periodic timer. However due a bug it is possible to put it into an infinite loop here. This occurs any time _pollingIntervalMilliseconds <= 0, which could occur for a few reasons:

  1. The listener specified EventCounterIntervalSec=0 after previously specifying a non-zero value. We would never expect a well-behaved listener to request a 0 sec interval, but the runtime shouldn't blindly trust this input.
  2. The listener enables and then disables the EventSource. Due to a race the infinite loop code could be run prior to re-checking _eventSource.IsEnabled() and it would observe _pollingIntervaMilliseconds=0

(from #53564)

Testing

The included test covers scenario 1, and manual testing was done for scenario 2.

Risk

This patch reduces overall risk by removing any looping based on user input. This should prevent scenario 1 and 2 above.

@ghost
Copy link

ghost commented Jun 10, 2021

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #53836 to release/5.0

/cc @hoyosjs @josalem

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Diagnostics.Tracing

Milestone: -

@josalem josalem self-assigned this Jun 10, 2021
Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

LGTM

@josalem
Copy link
Contributor

josalem commented Jun 11, 2021

I'll update the test to the one in #54081 once it merges

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jun 15, 2021
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We will take for consideration in 5.0.x

@jeffschwMSFT jeffschwMSFT added this to the 5.0.x milestone Jun 15, 2021
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 15, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.8 Jun 15, 2021
@mmitche mmitche merged commit fbf7306 into release/5.0 Jun 15, 2021
@akoeplinger akoeplinger deleted the backport/pr-53836-to-release/5.0 branch June 24, 2021 11:02
@ghost ghost locked as resolved and limited conversation to collaborators Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants