immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
dergutemoritz 2017-02-14T20:20:38.000385Z

Hey everyone, I have a question about immutant.web.async: It seems to me that there is no provision of flow control, so I'm a little worried that my application's memory usage will blow up indefinitely if it sends data at a higher rate than the receiver is able to keep up with. In other words: With send! being asynchronous, is there an unbounded transmission queue hiding in the innards of Immutant or rather Undertow somewhere?

2017-02-14T21:00:20.000386Z

@dergutemoritz: the actual writes are limited by the number of threads in a thread pool - each send gets enqueued, then popped and handled by a loop in a worker thread. If writing the data blocks, that worker will block. However, the queue that worker is reading from is unbounded, so you could exhaust memory if you enqueue (call send) faster than it is written

2017-02-14T21:01:08.000387Z

it may be possible for us to make that a bounded queue, and have send! block when it is full

dergutemoritz 2017-02-14T21:06:16.000388Z

@tcrawley Thanks, that confirms my suspicion. Yeah, I think it's never a good idea to place unbounded queues in such places, cf. core.async's insistence on not allowing that 🙂

dergutemoritz 2017-02-14T21:08:43.000389Z

So I would definitely recommend doing something about that. Is this concerning Immutant or Undertow?

2017-02-14T21:09:41.000390Z

this would be in Immutant itself - would you mind filing an issue at https://issues.jboss.org/projects/IMMUTANT?

2017-02-14T21:10:29.000391Z

it's been a long time since I wrote/looked at that code, so I may be reading it wrong. It seems like it would be relatively straightforward to confirm it is indeed a problem

dergutemoritz 2017-02-14T21:11:52.000392Z

@tcrawley Sure! Looking at the existing issues, https://issues.jboss.org/browse/IMMUTANT-562 seems related

dergutemoritz 2017-02-14T21:12:08.000393Z

Or did you refer to something else there?

2017-02-14T21:12:29.000394Z

ah, yes, indeed. that is related

2017-02-14T21:12:42.000395Z

feel free to comment there

dergutemoritz 2017-02-14T21:13:01.000396Z

:thumbsup: Will do

2017-02-14T21:13:08.000397Z

thanks!

dergutemoritz 2017-02-14T21:31:51.000398Z

OK, I hope I managed to express myself well enough, it's already a bit late over here 🙂

dergutemoritz 2017-02-14T21:32:07.000399Z

(in the comment I just added to that ticket, that is)

2017-02-14T21:32:28.000400Z

cool, thanks!

dergutemoritz 2017-02-14T21:35:00.000401Z

You're welcome! And thanks for Immutant 🙂

2017-02-14T21:35:20.000402Z

aw, shucks. you're welcome!