-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-1707: Preemptively cancel in progress operations when SDAM heartbeats timeout. #1170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
d0c2c66
DRIVERS-4026: Preemptively cancel in progress operations when SDAM he…
DmitryLukyanov ae50b04
Update unified test format spec.
DmitryLukyanov 3dea134
Update change log.
DmitryLukyanov dc0342f
Update link.
DmitryLukyanov 80cfea9
Update unified test format wording
DmitryLukyanov 82ce69a
Fix yml structure
DmitryLukyanov aeff456
Fix yml structure.
DmitryLukyanov 8dcce40
Code review.
DmitryLukyanov ca6affd
tests simplification
DmitryLukyanov 5e79c4b
update sdam yml file
DmitryLukyanov 0b4c229
Update source/unified-test-format/unified-test-format.rst
DmitryLukyanov a068be9
Update source/unified-test-format/unified-test-format.rst
DmitryLukyanov d8b53ba
Update source/unified-test-format/unified-test-format.rst
DmitryLukyanov 4a93643
Add invalid unified test
DmitryLukyanov 44965f1
add pool integration test.
DmitryLukyanov 21b47f2
Add yml comments
DmitryLukyanov d53c15e
change yml formatting
DmitryLukyanov e9f930b
Add retry write test
DmitryLukyanov f727192
Fix yml formatting.
DmitryLukyanov 994884b
Remove wait in pool-clear-closing-pending-connections.
DmitryLukyanov b793955
Fix event ordering. Don't call standalone tests.
DmitryLukyanov a0b35e9
Code review.
DmitryLukyanov cccc06e
Rename tests.
DmitryLukyanov bfd75b2
Rename tests.
DmitryLukyanov 3b06c4a
Renaming
DmitryLukyanov 7711a1f
Define "interrupt" meaning.
DmitryLukyanov c299046
Cherrypick origin changes.
DmitryLukyanov f9e3297
Formatting.
DmitryLukyanov d7f57e1
Fix typo.
DmitryLukyanov 383464f
Update test.
DmitryLukyanov 988ca92
Update source/connection-monitoring-and-pooling/connection-monitoring…
DmitryLukyanov 5494c63
Code review
DmitryLukyanov 10b7ae8
yml formatting.
DmitryLukyanov 33c57e0
Merge branch 'DRIVERS-4026' of https://github.com/DmitryLukyanov/spec…
DmitryLukyanov 88fb3a0
remove `pool-clear-interrupt-in-use`
DmitryLukyanov e8a34c9
Code review
DmitryLukyanov 6f72375
Formatting.
DmitryLukyanov a318540
Rewording.
DmitryLukyanov a8dbd02
Update source/server-discovery-and-monitoring/server-monitoring.rst
DmitryLukyanov 3704c24
Code review.
DmitryLukyanov 370dd7a
Merge branch 'DRIVERS-4026' of https://github.com/DmitryLukyanov/spec…
DmitryLukyanov ede9d8d
Code review.
DmitryLukyanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
source/connection-monitoring-and-pooling/tests/pool-clear-interrupt-immediately.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"version": 1, | ||
"style": "unit", | ||
"description": "Connections MUST be interrupted as soon as possible (interruptInUseConnections=true)", | ||
"poolOptions": { | ||
"backgroundThreadIntervalMS": 10000 | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "checkOut" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"label": "conn" | ||
}, | ||
{ | ||
"name": "clear", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionPoolCleared", | ||
"count": 1, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionClosed", | ||
"count": 2, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "close" | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 1, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 2, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"reason": "stale", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"reason": "stale", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolClosed", | ||
"address": 42 | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionCreated", | ||
"ConnectionPoolReady", | ||
"ConnectionReady", | ||
"ConnectionCheckOutStarted", | ||
"ConnectionPoolCreated", | ||
"ConnectionCheckedIn" | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
source/connection-monitoring-and-pooling/tests/pool-clear-interrupt-immediately.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: 1 | ||
style: unit | ||
description: Connections MUST be interrupted as soon as possible (interruptInUseConnections=true) | ||
poolOptions: | ||
# ensure it's not involved by default | ||
backgroundThreadIntervalMS: 10000 | ||
operations: | ||
- name: ready | ||
- name: checkOut | ||
- name: checkOut | ||
label: conn | ||
- name: clear | ||
interruptInUseConnections: true | ||
- name: waitForEvent | ||
event: ConnectionPoolCleared | ||
count: 1 | ||
timeout: 1000 | ||
- name: waitForEvent | ||
event: ConnectionClosed | ||
count: 2 | ||
timeout: 1000 | ||
- name: close | ||
events: | ||
- type: ConnectionCheckedOut | ||
connectionId: 1 | ||
address: 42 | ||
- type: ConnectionCheckedOut | ||
connectionId: 2 | ||
address: 42 | ||
- type: ConnectionPoolCleared | ||
interruptInUseConnections: true | ||
- type: ConnectionClosed | ||
reason: stale | ||
address: 42 | ||
- type: ConnectionClosed | ||
reason: stale | ||
address: 42 | ||
- type: ConnectionPoolClosed | ||
address: 42 | ||
ignore: | ||
- ConnectionCreated | ||
- ConnectionPoolReady | ||
- ConnectionReady | ||
- ConnectionCheckOutStarted | ||
- ConnectionPoolCreated | ||
- ConnectionCheckedIn |
77 changes: 77 additions & 0 deletions
77
.../connection-monitoring-and-pooling/tests/pool-clear-interrupting-pending-connections.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"version": 1, | ||
"style": "integration", | ||
"description": "clear with interruptInUseConnections = true closes pending connections", | ||
"runOn": [ | ||
{ | ||
"minServerVersion": "4.9.0" | ||
} | ||
], | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": "alwaysOn", | ||
"data": { | ||
"failCommands": [ | ||
"isMaster", | ||
"hello" | ||
], | ||
"closeConnection": false, | ||
"blockConnection": true, | ||
"blockTimeMS": 1000 | ||
} | ||
}, | ||
"poolOptions": { | ||
"minPoolSize": 0 | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "start", | ||
"target": "thread1" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"thread": "thread1" | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionCreated", | ||
"count": 1 | ||
}, | ||
{ | ||
"name": "clear", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionCheckOutFailed", | ||
"count": 1 | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckOutStarted" | ||
}, | ||
{ | ||
"type": "ConnectionCreated" | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"type": "ConnectionClosed" | ||
}, | ||
{ | ||
"type": "ConnectionCheckOutFailed" | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionCheckedIn", | ||
"ConnectionCheckedOut", | ||
"ConnectionPoolCreated", | ||
"ConnectionPoolReady" | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
...e/connection-monitoring-and-pooling/tests/pool-clear-interrupting-pending-connections.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: 1 | ||
style: integration | ||
description: clear with interruptInUseConnections = true closes pending connections | ||
runOn: | ||
- | ||
minServerVersion: "4.9.0" | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: "alwaysOn" | ||
data: | ||
failCommands: ["isMaster","hello"] | ||
closeConnection: false | ||
blockConnection: true | ||
blockTimeMS: 1000 | ||
poolOptions: | ||
minPoolSize: 0 | ||
operations: | ||
- name: ready | ||
- name: start | ||
target: thread1 | ||
- name: checkOut | ||
thread: thread1 | ||
- name: waitForEvent | ||
event: ConnectionCreated | ||
count: 1 | ||
- name: clear | ||
interruptInUseConnections: true | ||
- name: waitForEvent | ||
event: ConnectionCheckOutFailed | ||
count: 1 | ||
events: | ||
- type: ConnectionCheckOutStarted | ||
- type: ConnectionCreated | ||
- type: ConnectionPoolCleared | ||
interruptInUseConnections: true | ||
- type: ConnectionClosed | ||
- type: ConnectionCheckOutFailed | ||
ignore: | ||
- ConnectionCheckedIn | ||
- ConnectionCheckedOut | ||
- ConnectionPoolCreated | ||
- ConnectionPoolReady |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably "a pool SHOULD force the next maintenance step..." needs to be clarified. Does this mean that the next step should be scheduled to run as soon as possible?
Maybe something like: The next Background Thread Run SHOULD be scheduled as soon as possible. Next pruning iteration MUST close "in use" perished connections if requested by closeInUseConnections flag...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should omit the last "requested by closeInUseConnections flag." part? As it might be interpreted as scheduling the next run sooner will be done only in
closeInUseConnections:true
case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do that, can we bump it to its own paragraph below this one? That way the
closeInUseConnections
and background thread scheduling parts will be in separate paragraphs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not notice the
A pool SHOULD allow immediate scheduling of the next background thread iteration after a clear is performed.
sentence. I am fine with current wording.nit: remove the dot from
connections.requested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done