-
Notifications
You must be signed in to change notification settings - Fork 3k
Refactor and add test for onOpen exception on WS Next #50344
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
Conversation
@mkouba I was expecting that an exception onOpen would not open the connection, but it does. |
@brunobat What's wrong with the reproducer if there are no changes needed in the codebase? I asked Michal to take a look, but we both are pretty busy with RHBQ releases (I'm on 3.15, Michal is on 3.27). So it may take time before we respond. |
138ba93
to
b51e14c
Compare
@rsvoboda I didn't debug your test because I was not able to build your test suite on my machine (I didn't spent much time on it). |
This comment has been minimized.
This comment has been minimized.
@brunobat I've tried this manually - the metric does NOT indeed appear on metrics endpoint after opening ws.next connection and getting an exception on open. I'm quite convinced the compilation error is because the branch is based on SNAPSHOT version, one that can be built and installed into your local maven repo directly out of main or version branch of Quarkus. More info at https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#using-snapshots I've updated the reproducer to use 999-SNAPSHOT of Quarkus, but you can easily change the version of Quarkus to a released one with Reproducer:
But you can also run the app in devmode (and set the version of Quarkus with
The |
b51e14c
to
68edd23
Compare
@rsvoboda @mjurc I added a test that replicates the issue you are finding: @mkouba should we really assume that if an error is handled we shouldn't increment the metric? On a side note, with the test suite it is though to reproduce this because there is too much wiring and assertion magic going on. |
This comment has been minimized.
This comment has been minimized.
I have no idea what this metric actually means 🤷. If an error handler exists then we don't apply the |
&
What I implemented based on @brunobat feedback (I could have misunderstood it) was that
I don't think this is completely fair, all the metrics are documented, when you look at them with Prometheus, for this metric you get I hope I am wrong, but this feels like heated discussion for such a minor thing. I think it can be easily fixed whatever you think is issue right now. The "docs" is just exporting what we have to adoc. |
@michalvavrik The issue is minor and I am sure it can be fixed, it's just that that metric description can lead to ambiguous interpretation, see the issue opened all the way back in April. Since then, the behaviour was changed (I think; the issue was closed by a PR), but the reproducer I wrote back in April still fails, so I think the description needs to be clarified a bit. I don't mind it getting the description added to docs, but it would be nice to know what to expect in the test. If the test is right, then we'll need a fix in Quarkus :) |
Will find a way to increment the metric even when the |
68edd23
to
424e667
Compare
After taking another look at the code and trying to implement what was discussed above, I still think the current code does the right thing.
Added refactoring because the client metric name for errors on open was not aligned with the server. These are all new metrics on a new domain, it's normal to have doubts about what thing really mean. I'm open to documentation improvements but I believe the metrics are correct. |
Status for workflow
|
@brunobat So just to make sure, the aim for the metric is to be increased on unrecoverable connection failure, yes? |
Correct |
Test for #47409 (comment)
@mjurc @rsvoboda, I'm fairly confident that the metric in Quarkus works as expected on current main. I tried the 3.27 branch but it doesn't compile on my machine (didn't debug that).
Added refactoring because the client metric name for errors on open was not aligned with the server.