[MXS-2593] Fake hangups from backend DCBs cause worker messages to be emitted Created: 2019-07-06 Updated: 2020-01-02 Resolved: 2020-01-02 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | mariadbbackend |
| Affects Version/s: | 2.2.21, 2.3.8, 2.4.0 |
| Fix Version/s: | 2.5.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | markus makela | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When a MariaDBBackend DCB is being closed, it emits a fake hangup event on the client DCB. The current code only has a fast path for events placed on the current DCB which causes a queued message to be posted on the worker itself every time a client connection is closed. In extreme cases this can cause lost messages if a large amount of backend connections close at the same time. |
| Comments |
| Comment by markus makela [ 2019-07-06 ] |
|
The hangup is only delivered if the session is already closing. This is not necessary but it also isn't harmful in and of itself. It does pose a risk that some other message doesn't fit into the worker queue theoretically causing a loss of a worker message. |
| Comment by markus makela [ 2019-07-08 ] |
|
Removed the superfluous hangup from the protocol closing code. This still leaves the hangups that are generated when an even on a backend DCB causes a hangup to be delivered on the client DCB but these are much less common in comparison to the original problem. |
| Comment by markus makela [ 2019-09-23 ] |
|
The hangups can in some cases be replaced with direct calls to DCB::close. If the hangup is done to the client DCB, a call to MXS_SESSION::terminate would also work. |
| Comment by markus makela [ 2020-01-02 ] |
|
|