Closed agalasso closed 4 months ago
Why would an app spray a stream of messages at the event server?
Agreed, that's probably why we do not hear about this problem. But in theory, an app should be allowed to send a multiple (overlapping) requests and then correlate the responses using the request ids -- we made this work with #780 and #781.
Another way to look at this pr is that it is completing the change started by #780.
event server: fix possible problems when client sends multiple requests
The
connect
command can cause the event loop to run and for the event server to process additional buffered client commands. As the JSON parser instance is reused for all client commands, the parser's state will reflect the most recent client command and may lose the state of the unfinished connect command.The fix is to not reuse the JsonParser instance -- instantiate a dedicated parser for each client command.
Testing: