Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 05ffe82

Browse files
committed
fix(sessions): never send endSessions from a ClientSession
Sessions are meant to be cached, and the `endSessions` command is only meant to be used as a way to signal to the server that cached sessions will no longer be used (due to the client closing). We were sending too many `endSessions` commands, now we just send the one. NODE-1418
1 parent 874c827 commit 05ffe82

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lib/sessions.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class ClientSession extends EventEmitter {
7878
* Ends this session on the server
7979
*
8080
* @param {Object} [options] Optional settings
81-
* @param {Boolean} [options.skipCommand] Skip sending the actual endSessions command to the server
8281
* @param {Function} [callback] Optional callback for completion of this operation
8382
*/
8483
endSession(options, callback) {
@@ -94,11 +93,6 @@ class ClientSession extends EventEmitter {
9493
this.abortTransaction(); // pass in callback?
9594
}
9695

97-
if (!options.skipCommand) {
98-
// send the `endSessions` command
99-
this.topology.endSessions(this.id);
100-
}
101-
10296
// mark the session as ended, and emit a signal
10397
this.hasEnded = true;
10498
this.emit('ended', this);

0 commit comments

Comments
 (0)