[GitHub] trafficserver issue #1598: Assertion failing when calling TSHttpTxnReenable ...

2017-03-20 Thread clearswift
Github user clearswift commented on the issue:

https://github.com/apache/trafficserver/issues/1598
  
I've tried that (and quite a few different things) and had the same result. 
The example was intended to be as minimal as possible.

There is an example plugin (examples/thread-1) that does the same thing as 
my example except that it uses a request related hook (OS_DNS). It doesn't use 
TSContSchedule to re-enable the transaction, but just does it in the thread 
function.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver issue #1598: Assertion failing when calling TSHttpTxnReenable ...

2017-03-20 Thread jpeach
Github user jpeach commented on the issue:

https://github.com/apache/trafficserver/issues/1598
  
You have to call `TSHttpTxnReenable` from an event thread. The typical 
pattern is to use `TSContSchedule` to bounce the call back over to the event 
thread pool once you are done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver issue #1598: Assertion failing when calling TSHttpTxnReenable ...

2017-03-20 Thread clearswift
GitHub user clearswift opened an issue:

https://github.com/apache/trafficserver/issues/1598

Assertion failing when calling TSHttpTxnReenable from another thread.

See the attached example plugin. This hooks onto the 
`TS_HTTP_READ_RESPONSE_HDR_HOOK` hook and, on that event, launches a thread 
that re-enables the transaction. This fails the assertion 
`ink_release_assert(!server_vc || !client_vc || server_vc->thread == 
client_vc->thread);` on line 5933 in HttpSM.cc when making multiple connections.

A simple test of this is to browse any reasonably substantial web page (I 
used bbc.co.uk) through the proxy with this plugin enabled. Removing the 
assertion allows the page to load successfully.

So why is the assertion there? What's the issue with the client and server 
threads being different? As I said, removing the assertion makes things work 
but is there some corner case where this matters?

Alternatively, is the plugin wrong? Is it allowed to call TSHttpTxnReenable 
from a different thread? Is there a better way to do this?


[ThreadTestPlugin.zip](https://github.com/apache/trafficserver/files/855468/ThreadTestPlugin.zip)







---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---