Skip to content

Conversation

@zentol
Copy link
Contributor

@zentol zentol commented Feb 13, 2018

What is the purpose of the change

This PR removes an unstable test for the PrometheusReporter. The test verified that the metrics could no longer be polled when the reporter was shutdown, however if any other process were to start a server on the same port (which is free after the reporter shutdown) the test would fail.

We could theoretically check in that case that it wasn't our reporter that responded, but that's a bit tricky to do with how the reporter currently works (singleton registry).

This PR also contains 2 minor changes:

  • one commit adds a comment to the prometheus reporter to better reflect how the HTTPServer is used
  • one commit adds a utility port-range generator to prevent port-conflicts caused by copy&pasting

…rterIsClosed()

The test is inherently unstable as it will always fail if any other
server is started on the port between the closing of the reporter and
the polling of metrics.
…aultRegistry

It appeared as if the HTTPServer wasn't actually doing anything, but it
internally accessed the singleton registry that we also access to
register metrics.
Copy link
Contributor

@kl0u kl0u 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 fixing this @zentol !
I just had one comment.
After integrating it, then feel free to merge.

* @return next port range
*/
public synchronized String next() {
if (!hasNext()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the synchronized here is not needed as there does not seem to be any concurrent access.

@asfgit asfgit closed this in 6c9a5c7 Feb 20, 2018
asfgit pushed a commit that referenced this pull request Feb 20, 2018
…rterIsClosed()

The test is inherently unstable as it will always fail if any other
server is started on the port between the closing of the reporter and
the polling of metrics.

This closes #5473.
@zentol zentol deleted the 8621 branch February 21, 2018 17:26
kbialek pushed a commit to kbialek/flink that referenced this pull request Feb 23, 2018
…rterIsClosed()

The test is inherently unstable as it will always fail if any other
server is started on the port between the closing of the reporter and
the polling of metrics.

This closes apache#5473.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants