On 11/08/17 15:14, Rémy Maucherat wrote:
> On Fri, Aug 11, 2017 at 3:14 PM, Sergey Mashkov <
> sergey.mash...@jetbrains.com> wrote:
>> Hi everyone
>> I am experiencing race condition: from time to time when I cann to
>> UpgradedServletOutputStream.setWriteListener(myCallback) servlet container
>> doesn't invoke neither myCallback.onWritePossible() nor .onError.
>> I believe the reason is that setWriteListener() method implementation sets
>> listener reference _AFTER_ it schedules dispatch/registers write listener.
>> I've checked regular (non-upgraded) CoyoteOutput and I see it's
>> implementation does the same but in correct order. Also I see that
>> UpgradedServletInputStream.setWriteListener also has such a strange order:
> Ok, I don't see why and if I place it in the sync above there's no
> testsuite issue. I'll wait for Mark to ack that though, just in case
> there's a trick.

I don't see any issue with moving "this.listener = listener;" above the

A similar change in UpgradeServletInputStream should be fine too.


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

Reply via email to