jira-importer opened a new issue, #852:
URL: https://github.com/apache/httpcomponents-core/issues/852

   **[Geir Harald 
Hansen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=drharibo)** 
opened 
**[HTTPCORE-294](https://issues.apache.org/jira/browse/HTTPCORE-294?redirect=false)**
 and commented
   
   I leave postponed responses for a separate thread to handle. When 
Cancellable#cancel() is invoked I signal this background thread and wait for it 
to signal back before returning true or false from cancel() depending on 
whether the response was cancelled or already sent. I'm assuming it is not OK 
to always return true immediately and attempt in the background to signal 
another thread to tell it to not submit a response, which it may still do if it 
doesn't get the signal in time.
   
   My program deadlocks if the background thread tries to submit a response 
after Cancellable#cancel() has been invoked. The IOReactor worker thread 
(inside cancel()) waits on the background thread, and the background thread is 
trying to submit a response, apparently needing a lock held by the IOReactor 
worker thread.
   
   Not sure if this is a bug or if I am "doing it wrong". But I think this is a 
trap many will fall in, so it would be best if this problem could be avoided.
   
   
   ---
   
   **Affects:** 4.2-beta1
   
   **Attachments:**
   - 
[Test.java](https://issues.apache.org/jira/secure/attachment/12516046/Test.java)
 (_3.37 kB_)
   - 
[threaddump.txt](https://issues.apache.org/jira/secure/attachment/12516047/threaddump.txt)
 (_6.15 kB_)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to