Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Until now, if a packet arrived from the server while the driver had no command in progress, the driver kept that packet and handed it to the next statement. From that point on, every statement on the connection received the previous statement's response: queries returned another caller's rows and update counts were wrong, with no error surfacing through the R2DBC API. Since the condition never self-corrects, a pooled connection kept serving shifted results for its whole lifetime.
Any packet received while no command is in flight is now treated as a fatal protocol error: it is logged and the connection is closed immediately. When the packet is an error packet ( for example MaxScale terminating a session ) the server message, error code and SQL state are logged, and reported to the application. The connection is then reported as invalid, so pools discard it and open a fresh one instead of reusing a desynchronised one.