taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

jetty exception on connection #387

Closed awb99 closed 3 years ago

awb99 commented 3 years ago

I use sente with jetty 0.14.0 (the last version supported by java 9). I watch the connection atom, and send welcome messages immediately to connected clients. Sometimes, but not always I get this message:

Exception in thread "async-dispatch-1" java.lang.IllegalStateException: Blocking message pending 10000 for BLOCKING
    at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.lockMsg(WebSocketRemoteEndpoint.java:130)
    at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.sendString(WebSocketRemoteEndpoint.java:376)
    at ring.adapter.jetty9.websocket$eval28180$fn__28181.invoke(websocket.clj:60)
    at ring.adapter.jetty9.websocket$eval28140$fn__28141$G__28131__28154.invoke(websocket.clj:27)
    at ring.adapter.jetty9.websocket$eval28196$fn__28197.invoke(websocket.clj:106)
    at ring.adapter.jetty9.websocket$eval28047$fn__28072$G__28028__28085.invoke(websocket.clj:19)
    at taoensso.sente.server_adapters.jetty9$eval28264$fn__28269.invoke(jetty9.clj:32)
    at taoensso.sente.interfaces$eval27708$fn__27720$G__27699__27729.invoke(interfaces.cljc:13)
    at taoensso.sente$send_buffered_server_evs_GT_ws_clients_BANG_.invokeStatic(sente.cljc:824)
    at taoensso.sente$send_buffered_server_evs_GT_ws_clients_BANG_.invoke(sente.cljc:817)
    at taoensso.sente$make_channel_socket_server_BANG_$send_fn__28442$flush_buffer_BANG___28449.invoke(sente.cljc:517)
    at taoensso.sente$make_channel_socket_server_BANG_$send_fn__28442$fn__28622$state_machine__11634__auto____28701$fn__28703.invoke(sente.cljc:560)
    at taoensso.sente$make_channel_socket_server_BANG_$send_fn__28442$fn__28622$state_machine__11634__auto____28701.invoke(sente.cljc:558)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:978)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:977)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:982)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:980)
    at clojure.core.async.impl.ioc_macros$take_BANG_$fn__11652.invoke(ioc_macros.clj:991)
    at clojure.core.async.impl.channels.ManyToManyChannel$fn__6433.invoke(channels.clj:265)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at clojure.core.async.impl.concurrent$counted_thread_factory$reify__6237$fn__6238.invoke(concurrent.clj:29)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.lang.Thread.run(Thread.java:748)
ptaoussanis commented 3 years ago

Hi there! Can you please confirm whether you're seeing the same issue with the reference example project?

And if you're seeing the same issue if you use your desired version of Jetty in the reference example project?

(BTW are you sure you want Jetty 0.14.0? That version seems wrong? Didn't look in detail though)

awb99 commented 3 years ago

I was referring to this dependency: [info.sunng/ring-jetty9-adapter "0.14.2"]

I have upgraded to [info.sunng/ring-jetty9-adapter "0.15.1"] which uses jetty 10, and currently I am not seeing this error anymore. It is nt an easily reproduceable error. I will revert in a week when I had more time to test

awb99 commented 3 years ago

This issue is not occuring on Jetty 10 anymore