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

Commit

Permalink
fix(sessions): never send endSessions from a ClientSession
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mbroadst committed Apr 18, 2018
1 parent 874c827 commit 05ffe82
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class ClientSession extends EventEmitter {
* Ends this session on the server
*
* @param {Object} [options] Optional settings
* @param {Boolean} [options.skipCommand] Skip sending the actual endSessions command to the server
* @param {Function} [callback] Optional callback for completion of this operation
*/
endSession(options, callback) {
Expand All @@ -94,11 +93,6 @@ class ClientSession extends EventEmitter {
this.abortTransaction(); // pass in callback?
}

if (!options.skipCommand) {
// send the `endSessions` command
this.topology.endSessions(this.id);
}

// mark the session as ended, and emit a signal
this.hasEnded = true;
this.emit('ended', this);
Expand Down

0 comments on commit 05ffe82

Please sign in to comment.