You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sergey Mashkov <se...@jetbrains.com> on 2016/10/27 10:15:35 UTC

setWriteListener and async operations concurrency

Hi

I am experiencing deadlock when trying to set output stream write listener:
The thread from my own thread pool is trying to set a write listener (my
code via setWriteListener call) and another one thread is
https-jsse-nio-N-exec is trying to close and flush (there is no my code in
the stack trace) and no more threads locked.
.
So the question is: is it even legal to call any async operation from
non-server thread? I see a lot of existing code in the web assumes that it
is. I also used to write so many times with no issues until now. This is
why I suppose it could be a tomcat bug.

Re: setWriteListener and async operations concurrency

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 27.10.2016 13:41, Sergey Mashkov wrote:
> On Thu, Oct 27, 2016 at 2:19 PM Andr� Warnier (tomcat) <aw...@ice-sa.com>
> wrote:
>
>> On 27.10.2016 12:15, Sergey Mashkov wrote:
>>> Hi
>>>
>>> I am experiencing deadlock when trying to set output stream write
>> listener:
>>> The thread from my own thread pool is trying to set a write listener (my
>>> code via setWriteListener call) and another one thread is
>>> https-jsse-nio-N-exec is trying to close and flush (there is no my code
>> in
>>> the stack trace) and no more threads locked.
>>> ..
>>> So the question is: is it even legal to call any async operation from
>>> non-server thread? I see a lot of existing code in the web assumes that
>> it
>>> is. I also used to write so many times with no issues until now. This is
>>> why I suppose it could be a tomcat bug.
>>>
>>
>> Hi.
>> Not an answer to your questions, but :
>> It would be good practice, and probably help a lot the people here to
>> answer your
>> questions, if you provided :
>> - the Tomcat version
>> - the Java version
>> - the platform OS and version
>> You can find all of those in the Tomcat logs, or by running the
>> (tomcat_dir)/bin/VERSION.(sh|bat)
>>
>
> It's more about the API and requirements: the documentation is not clear
> about threading. But if it's a bug then it could be significant

The documentation also corresponds to the version of Tomcat, so it is significant and 
useful (and mainly it saves time for the list volunteers) if you specify what you are 
looking at.

You want free expert advice. You will get it on this list.
But the easier and less time-consuming you make it for these experts, the quicker you will 
have your expert response.

>
> Versions are 9.0.0M6 and M11, java 8u112, Linux x86_64
>
Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: setWriteListener and async operations concurrency

Posted by Sergey Mashkov <se...@jetbrains.com>.
On Thu, Oct 27, 2016 at 2:19 PM André Warnier (tomcat) <aw...@ice-sa.com>
wrote:

> On 27.10.2016 12:15, Sergey Mashkov wrote:
> > Hi
> >
> > I am experiencing deadlock when trying to set output stream write
> listener:
> > The thread from my own thread pool is trying to set a write listener (my
> > code via setWriteListener call) and another one thread is
> > https-jsse-nio-N-exec is trying to close and flush (there is no my code
> in
> > the stack trace) and no more threads locked.
> > ..
> > So the question is: is it even legal to call any async operation from
> > non-server thread? I see a lot of existing code in the web assumes that
> it
> > is. I also used to write so many times with no issues until now. This is
> > why I suppose it could be a tomcat bug.
> >
>
> Hi.
> Not an answer to your questions, but :
> It would be good practice, and probably help a lot the people here to
> answer your
> questions, if you provided :
> - the Tomcat version
> - the Java version
> - the platform OS and version
> You can find all of those in the Tomcat logs, or by running the
> (tomcat_dir)/bin/VERSION.(sh|bat)
>

It's more about the API and requirements: the documentation is not clear
about threading. But if it's a bug then it could be significant

Versions are 9.0.0M6 and M11, java 8u112, Linux x86_64


>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: setWriteListener and async operations concurrency

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 27.10.2016 12:15, Sergey Mashkov wrote:
> Hi
>
> I am experiencing deadlock when trying to set output stream write listener:
> The thread from my own thread pool is trying to set a write listener (my
> code via setWriteListener call) and another one thread is
> https-jsse-nio-N-exec is trying to close and flush (there is no my code in
> the stack trace) and no more threads locked.
> ..
> So the question is: is it even legal to call any async operation from
> non-server thread? I see a lot of existing code in the web assumes that it
> is. I also used to write so many times with no issues until now. This is
> why I suppose it could be a tomcat bug.
>

Hi.
Not an answer to your questions, but :
It would be good practice, and probably help a lot the people here to answer your 
questions, if you provided :
- the Tomcat version
- the Java version
- the platform OS and version
You can find all of those in the Tomcat logs, or by running the
(tomcat_dir)/bin/VERSION.(sh|bat)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org