immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
favila 2017-07-19T01:33:46.491362Z

I was using immutant.web.async/as-channel to free up workers early for longer http requests, like this:

favila 2017-07-19T01:33:53.492642Z

(let [f (future (expensive-response))]
  (async/as-channel
    {:on-open (fn [ch] (async/send! ch @f {:close? true}))}))

favila 2017-07-19T01:35:12.508597Z

In immutant 2.1.6, this works, but in 2.1.7 and 2.1.9 this doesn't. After enough requests (= to number of workers, approx 4) all future requests hang

favila 2017-07-19T01:37:05.531267Z

It's as if those channels are not closing. But I did look in a debugger and observe UndertowHttpChannel.send(message, shouldClose, onComplete) called with message = bytes[] and shouldClose=true.

favila 2017-07-19T01:37:44.539399Z

Help?

2017-07-19T17:55:45.460767Z

@favila sorry you're having trouble. if it worked in 2.1.6, then I expect we introduced a regression with the fixes for either IMMUTANT-627, IMMUTANT-630, or IMMUTANT-632

2017-07-19T17:59:07.584928Z

you might try overriding your undertow dep[s] to 1.3.23.Final to rule out 627

favila 2017-07-19T19:15:46.237493Z

@jcrossley3 thanks investigating. So newer immutant should work with older 1.3.x series undertow?

favila 2017-07-19T19:16:30.261428Z

(I will need 1.4.19 for UNDERTOW-1139 eventually, but I could at least isolate whether undertow or immutant is reponsible)

2017-07-19T20:13:40.085467Z

@favila yes, it should work. and that would be great if you could confirm 627 introduced the regression.

2017-07-19T20:14:40.115918Z

i say should, but who knows 🙂

favila 2017-07-19T22:21:17.600938Z

@jcrossley3 This works:

[org.immutant/web "2.1.9"
                  :exclusions [io.undertow/undertow-core io.undertow/undertow-servlet io.undertow/undertow-websockets-jsr ]
                  ]
                 [io.undertow/undertow-core "1.3.23.Final"]
                 [io.undertow/undertow-servlet "1.3.23.Final"]
                 [io.undertow/undertow-websockets-jsr "1.3.23.Final"]

favila 2017-07-19T22:21:27.604471Z

(i.e. depending on 1.3.23.Final)

favila 2017-07-19T22:22:33.625673Z

so something about 1.4.x, or the interaction between UndertowHttpChannel and 1.4.x, causes this

favila 2017-07-19T22:26:01.693351Z

@jcrossley3 1.3.30.Final also works (latest stable on 1.3.x I believe)

favila 2017-07-19T23:06:35.414750Z

I can't manage to make a minimal though