Websocket: NotUtf8Exception after upgrade 9.4.35 -> 9.4.36 or newer #6050
After upgrading jetty from 9.4.35.v20201120 to 9.4.36.v20210114 in our prod env we found a significant amount of NotUtf8Exception exceptions during unpacking text WebSocket messages.
Also, we found that disabling permessage-deflate ( with factory.getExtensionFactory().unregister("permessage-deflate") ) is fixing this problem.
I suspect a bug created in #5499 (Significant refactoring of PerMessageDeflate), but we have no scenario to reproduce (except for deploying a heavily loaded production server processing lots of user's documents)
Stacktraces usually have different messages NotUtf8Exception (byte xx in state y, incomplete UTF8 sequence). I suspect the exception is caused by random (possibly of multithreading?) damage of buffer data.
One of StackTrace (v 9.4.38.v20210224):
The text was updated successfully, but these errors were encountered:
This would be very surprising. (we pass all of the industry websocket test tooling for compliance to the spec)
Can you replicate this?
Our policy forbids capturing user's data (as it may contain private information).
Clients use the browser's WebSocket implementation, and there are multiple versions of chrome and firefox (including the latest) in logs with these exceptions, so they are not likely to have a bug in permessage-deflate.
BTW, I see no changes in 9.4.36 changing permessage-deflate algorithm, all changes are in buffering.
Here is modified