cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhawal (JIRA)" <>
Subject [jira] [Commented] (CXF-7246) PhaseInterceptorChain's Message is not passed to child threads.
Date Mon, 03 Apr 2017 05:25:41 GMT


Dhawal commented on CXF-7246:


Just to follow up, in the case u mentioned, if that Message Object is inherited by any of
the child threads then it should remain alive till the child thread is alive, this should
be the case. In case in any asynchronous model once any object is passed onto any child thread
or a thread pool then that object will remain in memory till that thread is alive, somehow
i am not convinced on the part of Memory Leak as either parent or child thread(created by
JMS/threadpool/thirdparty) will be referring or owning/referring that Message Object. 

We have fix in place for this. Just to reiterate my point is we need to have some mechanism
in place where if someone is using Message in multi-threaded environment then its just doesn't
work. If we find any such alarming situation will let you guys know. 


> PhaseInterceptorChain's Message is not passed to child threads. 
> ----------------------------------------------------------------
>                 Key: CXF-7246
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.14
>            Reporter: Dhawal
>             Fix For: Invalid
> Hello,
> We put few information(usually request header information) in Message through RequestHandler
by doing PhaseInterceptorChain.getCurrentMessage.getExchange.put("","");  
> But when we create a new Threads from the thread which brings in request to the controller,
those objects which are put in the Exchange are not available to new threads.  The PhaseInterceptorChain
has Message object which is ThreadLocal so the objects are not available to subsequent threads
which are created, so exploiting parallelism is quite painful once we store something in Exchange
> As a suggestion can we have Message object as optional between ThreadLocal and InheritableThreadLocal
and via a configuration we can set that do we need to make available Message object to child
> Thanks,
> Dhawal Patel

This message was sent by Atlassian JIRA

View raw message