GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Race condition in MessageToMessageEncoder if ch.write(..) is called from channelWritabilityChanged · Issue #5028 · netty/netty Open Labels DescriptionHi, I triggered a race condition by calling ctx.channel().write(...) from channelWritabilityChanged. One can argue if it's a bug or expected behavior, but since I think it is very hard to track down for new netty users it should be fixed or the user should be warned in documentation of channelWritabilityChanged. Assuming your handler calls write in "channelWritabilityChanged" e.g. like: and then write something to the channel you end up triggering a race condition in MessageToMessageEncoder breaking HTTP chunked transfer. This could produce this output: a - size(someChunk) instead of a - size(someChunk) Browser won't parse that and terminate the http connection. This is because MessageToMessageEncoder triggers multiple writes for each HTTP chunk (chunk size, CRLF, chunk content, CRLF). channelWritabilityChanged seems to get fired between these writes: Since we are still inside the eventloop, the the write inside channelWritabilityChanged is executed right away before the chunk is written completely. I fixed it for me by no longer directly invoking write from channelWritabilityChanged: So in my opinion, enqueuing channelWritabilityChanged in the eventloop could fix it inside netty. Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |