[undertow-dev] Dispatching to non IO threads

Bill O'Neil bill at dartalley.com
Wed Sep 17 19:03:41 EDT 2014


Thanks,  I will submit a pull request if I notice it anywhere else.

On Wednesday, September 17, 2014, Stuart Douglas <sdouglas at redhat.com>
wrote:

> I will change EagerFormParsingHandler to call parseBlocking() if the
> exchange is in blocking mode.
>
> Stuart
>
> Bill O'Neil wrote:
>
>> I have come across a few Handlers that dispatch to a worker thread these
>> include blocking handler, resource handler and the form parsing handler.
>>
>> My specific use case was with the form parsing handler.  I had a bunch
>> of handlers chained together basically as follows.
>>
>> Blocking handler -> ExceptionHandler -> FormParsingHandler ->
>> MyBlockingHandler
>>
>> The form parsing handler would cause the handler to be dispatched a
>> second time to a new executor.  This made me lose the stack trace, and
>> the Exception handler was not catching an exception being thrown inside
>> of MyBlockingHandler.
>>
>> I resolved this by basically cloning the form parsing handler and
>> calling the parseBlocking() instead of the non blocking parse().  This
>> is acceptable because I already dispatched to a non IO thread.
>>
>> Should any handler that attempts to dispatch first check if the exchange
>> is in an IO thread before dispatching or is there a specific use case
>> for some handlers to always dispatch?
>>
>> Thanks,
>> Bill
>>
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140917/175d758a/attachment.html 


More information about the undertow-dev mailing list