You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Krzysztof Jamróz (Jira)" <ji...@apache.org> on 2021/02/11 12:34:00 UTC

[jira] [Comment Edited] (CAMEL-16178) Enrich with REST+netty hangs when connection is closed without response

    [ https://issues.apache.org/jira/browse/CAMEL-16178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283010#comment-17283010 ] 

Krzysztof Jamróz edited comment on CAMEL-16178 at 2/11/21, 12:33 PM:
---------------------------------------------------------------------

I might try to fix it, but I am not sure if adding another flag in {{ClientChannelHandler}} (or maybe in {{NettyCamelState}}), for example {{callbackCalled}} and checking it instead of UoW presence is correct and is the right approach as this would make logic in {{ClientChannelHandler}} even more complex than it already is.


was (Author: krzysztofjamroz):
I might try to fix it, but I am not sure if adding another flag in {{ClientChannelHandler}} (or maybe in {{NettyCamelState}})), for example {{callbackCalled}} and checking it instead of UoW presence is correct and is the right approach as this would make logic in {{ClientChannelHandler}} even more complex than it already is.

> Enrich with REST+netty hangs when connection is closed without response
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-16178
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16178
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.4.5, 3.7.2
>            Reporter: Krzysztof Jamróz
>            Priority: Major
>         Attachments: EnrichWithoutRestResponseTest.java
>
>
> Enricher hangs when used with REST endpoint utilizing netty when there is no response from the server but the server immediately closes the connection. In such case read timeout is ignored as connection is already closed.
>  
> The reason of this behavior is that {{org.apache.camel.component.netty.handlers.ClientChannelHandler.channelInactive}} contains following conditions for callback invocation when there was no response: 
> {code:java}
> configuration.isSync() && !doneUoW && !messageReceived && !exceptionHandled
> {code}
> where
> {code:java}
> doneUoW = exchange.getUnitOfWork() == null
> {code}
> It works as expected when initially there had been UoW in Exchange (this is the case when using {{to}}). However, enricher by default (and by design) clears UoW for exchange it creates and this breaks above check.
> Setting {{shareUnitOfWork}} for {{enrich}} works around the problem.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)