-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using channel Local : java.lang.IllegalStateException: await*() in I/O thread causes a dead lock or sudden performance drop. Use addListener() instead or call await*() from a different thread. #387
Comments
Oh, and by the way, I just try to add a new ExecutionHandler in the pipeline to ensure I have one and ... The error still remains there ! So I suppose there is an issue in the detection ? But it does not impact "Network" channels... |
The only thing I saw that might be related is the following fix: 7800187#src/main/java/org/jboss/netty public final void run() { I used a different ExecutorService but with the same Executor behind on Server and Client side. Any idea ? |
Small correction on the behavior, here is the scenario I found out:
But there is an OMATPE in each step, so why ? Here is the exception trace:
So the exception is raized while the wait is really not called from an IO thread (see the stack trace)... |
Finally by making step by step, it seems it is more in ChannelEventRunnable that the issue is.
and later on when the wait occurs:
So, have you any idea ? |
Could you have show me code to Reproduce it? |
And to finish with this from my analysis part: I double check, and the Executor that is set in ChannelEventRunnable and checked later on is my Local OrderedMemoryAwareThreadPoolExecutor, not an Executor from Netty on IO thread part... |
Hmm, for a code to reproduce, I will try (I have to go to a meeting right now). |
|
@trustin I now this way, but as you said, it is not recommended. |
Hi, I managed to make an almost clean example. Almost since the client does not finished correctly with the answer, but that was not the goal of this example. The logic is :
In Netty 3.5.beta, everything is ok (except the client that did not finished with the data, but that's out of concern here). The code can be downloaded from the following link: https://docs.google.com/open?id=0B-tOt1H9VwrFbkFTM3FyOVhvbE0 |
Please do not create a milestone when not necessary. Setting the milestone to 3.5.1.Final. |
First sorry, I mis type the milestone when I add my comment I try to understand how to fix it. For the moment, I am able to fix it by testing if the executor is of type MATPE (and therefore also OMATPE and subtypes). But I would like to highlight that I don't understand how a single object (static) could be shared among all threads when they want to test the executor behaviour is correct while this logic is local to one channel. So there might be another solution more stable or more clean... By the way, I simplify the test example, and I uploaded it again to the following. I tried also by using only LocalChannel but no issue were encoutentered. So it means the issue comes when we have both Network and Local Channel (which I do to enable multiplexing). https://docs.google.com/open?id=0B-tOt1H9VwrFQ2QzMm9ZUDFJVWc |
@fredericBregier sorry I was quite busy.. I will try to have a look today or tomorrow latest. |
@fredericBregier Will check tomorrow.. To busy today :( |
…se-positives on deadlock detection. See #387
@fredericBregier could you please retest with latest code from 3 branch ? |
@normanmaurer Yes I confirm that with the latest 3 branch it is ok. I close this issue and the proposal. |
@normanmaurer hey,I am facing the same issue under the same situation,and my deal way is using a temp param to save the Executor before call write and read from another netty server,after finishing the connection,then set the temp Executor back,just like this: |
Hi,
Between version 3.5.0.beta and 3.5.0 final, a change occurs concerning Local Channel. This brings issue in my project.
Previously, there were no issue to have an await*() in such channel, since it is in thread only.
Now, it always sends the following error :
java.lang.IllegalStateException: await_() in I/O thread causes a dead lock or sudden performance drop. Use addListener() instead or call await_() from a different thread.
My point of view is that for Channel Local, it should not be necessary to add in addition a new thread layer between the channel handling and the work to be done. It could have IMHO some huge impact in performance to be obliged to add in addition such a thread. Most of the time, those Channel Local are already within a thread (and for me always) that is separated from a real Channel interface (networked one).
Is there any reason for this change ?
Not to say it will have a huge impact in my code, but if there is a real reason, ok I will do the necessary changes on my side, but I do think it seems unecessary for such Local Channel handling...
The text was updated successfully, but these errors were encountered: