-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Exception logged by quarkus after SSE client is closed - "Failed to mark a promise as failure because it has failed already: DefaultChannelPromise failure: java.nio.channels.ClosedChannelException" #9194
Comments
a working implementation of this can be found here: https://github.com/maxant/kafka-data-consistency/blob/master/objects/src/main/java/ch/maxant/kdc/objects/ObjectResource.java |
Hi I'm also getting too many similar crashes. Is there any workaround for that? |
This is my crash traces https://sentry.io/share/issue/2ed01930df494218aca52e49cb1cf237/ |
@itboy87 i don't know why you tagged me specifically. this is not my area of expertise. |
Sorry i thought may be you are dealing with issues on github can you please
tag relevant developer?
…On Tue, 2 Jun 2020 at 9:05 AM, Justin Lee ***@***.***> wrote:
@itboy87 <https://github.com/itboy87> i don't know why you tagged me
specifically. this is not my area of expertise.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9194 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUSZDGVJCNFPEAKN6NSM63RUR27DANCNFSM4M5HMRNA>
.
|
I have the same issue
|
@FroMage is this with you? |
Well, perhaps, but I don't quite understand this issue. Perhaps @vietj can help me make sense of it? |
I think that exception occur only when client close connection before request complete. So i don't think its bug but warning. But better if logs more clear like "connection closed by client" |
OK I can reproduce. This doesn't happen on Undertow. |
@patriot1burke do you remember why you added the |
@FroMage If you look at BufferImpl.getByteBuf() it does a copy of the underlying netty ByteBuf. VertxBufferImpl does not. There's a number of places in the quarkus code which access the underlying ByteBuf FYI, undertow has the same VertxBufferImpl implementation and I derived resteasy's implementation from that. |
Ah OK. Except apparently there's a bug somewhere wrt buffer deallocation, which leads to those warnings. How can we go about fixing that, if we can't take Vert.x's impl which doesn't have this bug? |
I don't know enough about vert.x or netty to give you a good answer. |
It looks to me like resteasy over raw vertx is not doing reference counting correctly and not really anything to do with the fact that VertxBufferImpl exists as a class. |
It's possible that both are related, in that vert.x will properly reference count its own buffer impl, and not ours? |
I do see in VertxBlockingOutput that I am releasing the ByteBuf on error. This "bug" shows up when connection is closed in the middle of a request? If so, the fact that VertxBlockingOutput releases the ByteBuf on errors might be the issue. |
I could test this, but I don't know if we should release it or not. |
I don't think I implemented the ByteBuf release code here (@johnaohara did): and defininately not here (that's your code stef): This may be the error as if you look at the "bug" report error stack track its trying to dereference a buffer that is already at 0. |
My commit, but code from @stuartwdouglas ;) |
I have the same issue and added quarkus-undertow dependency for workaround |
I have no clue why, but adding this dependency solved my problem too. |
As @FroMage said, it looks like there's a buffer deallocation bug that causing these warnings and undertow does not make this in the implementation it uses under the hood. |
I had the same issue. Adding quarkus-undertow dependency worked for me too. Thanks! |
I am still experiencing this problem with 1.10.5 and would like a fix for this problem as its spamming logs with warnings. |
@stuartwdouglas does it ring a bell? |
Describe the bug
I have a service method which SSE clients can use to subscribe to a stream. It returns a Multi. I have a second method which can be used to emit data. The SSE clients receive the data. Everything works fine, and as expected, except that after a client has disconnected, a warning is logged that it
Failed to mark a promise as failure because it has failed already: DefaultChannelPromise failure: java.nio.channels.ClosedChannelException
.Expected behavior
No warning should be logged, as nothing abnormal has actually happened.
Actual behavior
A warning is logged, as shown above.
To Reproduce
Steps to reproduce the behavior:
subscribe using curl:
curl -v -X GET localhost:8086/objects/changes/aClient
hit ctrl+c to close that client. Nothing happens yet in Quarkus, but that is OK, because it is quite standard to use a heart beat to deal with that. This is also required in some SSE servlet implementations.
emit an event using curl:
curl -v -X GET localhost:8086/objects/emit
the subscriber is correctly removed from the model
the unexpected warning is logged
Configuration
Screenshots
Environment (please complete the following information):
Output of
uname -a
orver
:Linux hades-ubuntu 5.3.0-51-generic Arc - request context propagation #44-Ubuntu SMP Wed Apr 22 21:09:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
:openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu219.10)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu219.10, mixed mode, sharing)
GraalVM version (if different from Java):
Quarkus version or git rev:
1.4.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
):Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /snap/intellij-idea-community/226/plugins/maven/lib/maven3
Java version: 11.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-51-generic", arch: "amd64", family: "unix"
Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: