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

IllegalStateException in SseBroadcaster #1499

Closed
kaikreuzer opened this issue May 24, 2020 · 1 comment · Fixed by #1698
Closed

IllegalStateException in SseBroadcaster #1499

kaikreuzer opened this issue May 24, 2020 · 1 comment · Fixed by #1698
Labels
bug An unexpected problem or unintended behavior of the Core
Milestone

Comments

@kaikreuzer
Copy link
Member

Testing an openHAB3 distro, I just found this in my log, which should not occur:

11:55:46.801 [WARN ] [apache.cxf.jaxrs.sse.SseEventSinkImpl] - There are still SSE events the queue which may not be delivered (closing now)
11:55:46.802 [WARN ] [g.openhab.core.io.rest.SseBroadcaster] - failure
java.lang.IllegalStateException: The sink has been already closed
       at org.apache.cxf.jaxrs.sse.SseEventSinkImpl.close(SseEventSinkImpl.java:157) [bundleFile:1.0.8]
       at org.openhab.core.io.rest.SseBroadcaster.close(SseBroadcaster.java:148) [bundleFile:?]
       at org.openhab.core.io.rest.SseBroadcaster.lambda$2(SseBroadcaster.java:109) [bundleFile:?]
       at java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986) [?:?]
       at java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970) [?:?]
       at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) [?:?]
       at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088) [?:?]
       at org.apache.cxf.jaxrs.sse.SseEventSinkImpl.dequeue(SseEventSinkImpl.java:256) [bundleFile:1.0.8]
       at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1392) [bundleFile:9.4.20.v20190813]
       at org.eclipse.jetty.server.AsyncContextState$1.run(AsyncContextState.java:149) [bundleFile:9.4.20.v20190813]
       at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
       at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
       at java.lang.Thread.run(Thread.java:834) [?:?]
@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Aug 21, 2020
@wborn wborn added this to the 3.0 milestone Oct 6, 2020
wborn added a commit to wborn/openhab-core that referenced this issue Oct 7, 2020
cweitkamp pushed a commit that referenced this issue Oct 7, 2020
* Prevent IllegalStateException when closing SSE sink
* Simplify code and log exceptions on debug

There seem to be no issues anymore with the exception handling when SSE clients disconnect so simplify the exception handling.
Suppressing exceptions based on error message is also likely to break when new exceptions are added or messages change.
There are also still exceptions that get logged with "failure" but from which the code seems to recover without any issues.

Fixes #1499

Signed-off-by: Wouter Born <[email protected]>
@schrej-zz
Copy link

Hi,
I still have warnings
[WARN ] [pache.cxf.jaxrs.sse.SseEventSinkImpl] - There are still SSE events the queue which may not be delivered (closing now)`
in my log. (OH 3.3.0-SNAPSHOT/Windows)

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 11, 2023
* Prevent IllegalStateException when closing SSE sink
* Simplify code and log exceptions on debug

There seem to be no issues anymore with the exception handling when SSE clients disconnect so simplify the exception handling.
Suppressing exceptions based on error message is also likely to break when new exceptions are added or messages change.
There are also still exceptions that get logged with "failure" but from which the code seems to recover without any issues.

Fixes openhab#1499

Signed-off-by: Wouter Born <[email protected]>
GitOrigin-RevId: 1edf25b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants