ring

Thierry 2024-03-22T16:26:06.606899Z

Just wondering if I'm having a brainfart or not. I'm experimenting with websockets. When I use the testcode for the jetty adapter for any of the websockets, this works just fine. But as soon as the jetty server config has :async true set as option any request takes atleast 60 seconds before anything happens. For example if I use this code without the surrounding clojure.test functions it obviously works fine, but when I add async true it stalls like explained. Even when I make the handler have respond raise etc. What am I doing wrong here? https://github.com/ring-clojure/ring/blob/f6cc0724d1f8ac1fbfdf7bad7ea9b778f80f7da2/ring-jetty-adapter/test/ring/adapter/test/jetty.clj#L806

weavejester 2024-03-23T13:38:12.137349Z

This should now be fixed in 1.12.1.

🙌 1
Thierry 2024-03-22T16:36:57.999199Z

That would be :async? true ofcourse

2024-03-22T17:02:43.919499Z

are you talking directly to jetty or going through any kind of proxy?

Thierry 2024-03-22T17:03:23.416879Z

Exactly like in the test fn. Even without hato from a browser, same results

2024-03-22T17:04:02.246749Z

60 seconds is suspiciously like a default timeout value

Thierry 2024-03-22T17:04:35.620849Z

Exactly what I thought. Already tried setting async-timeout to 0 explicitely

2024-03-22T17:55:23.373789Z

ring is failing to call complete on the async context looks like

2024-03-22T18:00:40.881439Z

https://downey.family/p/2024-03-22/jetty-test.clj.html is a little reproducer, it monkey patches ring to call complete, but if you comment out the monkey patch it hangs

Thierry 2024-03-22T20:28:31.723819Z

Interesting, will try this

2024-03-22T20:29:26.098719Z

I opened a ticket here https://github.com/ring-clojure/ring/issues/499

Thierry 2024-03-22T20:30:26.811249Z

Gave it a thumbs up, thanks

weavejester 2024-03-23T02:32:50.279709Z

Thanks for the report. I was wondering how this could have gotten past the tests, but it looks like websockets with async was never put in! I'll update and release a patch.

🎉 3