[SERVER-32477] ASIOSession fails to gracefully teardown sockets Created: 28/Dec/17 Updated: 30/Oct/23 Resolved: 03/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | 3.6.0, 3.6.1 |
| Fix Version/s: | 3.6.4, 3.7.1 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Matt Broadstone | Assignee: | Matt Broadstone |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v3.6
|
||||
| Sprint: | Platforms 2018-01-15 | ||||
| Participants: | |||||
| Description |
|
In the cleanup handler of ServiceStateMachine we depend on socket teardown to occur as part of the destruction of a Session instance, however ASIOSession omits a dtor and leaves the job up to asio. Unfortunately, while this results in actually closing the socket, it does not do so gracefully, leaving the client side guessing what the current state is only to find a ECONNRESET on subsequent attempts to write. ASIOSession has most of the complete implementation for graceful shutdown in its shutdown method (notably omitting an explicit call to close the sockets), and everything behaves as expected if that's called in the ASIOSession dtor. |
| Comments |
| Comment by Githook User [ 05/Apr/18 ] |
|
Author: {'email': 'william.schultz@mongodb.com', 'name': 'William Schultz', 'username': 'will62794'}Message: |
| Comment by Githook User [ 05/Apr/18 ] |
|
Author: {'email': 'jbreams@mongodb.com', 'name': 'Jonathan Reams', 'username': 'jbreams'}Message: |
| Comment by Githook User [ 05/Apr/18 ] |
|
Author: {'email': 'mbroadst@gmail.com', 'name': 'Matt Broadstone', 'username': 'mbroadst'}Message: We were depending on the dtor for the basic_stream_socket to (cherry picked from commit 4108212bffdad96a5be22e2fc71038f48d8740a4) |
| Comment by Githook User [ 03/Jan/18 ] |
|
Author: {'name': 'Matt Broadstone', 'username': 'mbroadst', 'email': 'mbroadst@gmail.com'}Message: We were depending on the dtor for the basic_stream_socket to |