Skip to content

Commit

Permalink
Implemented domain backward comp support enabled via domainsEnabled o…
Browse files Browse the repository at this point in the history
…ptions on Server/ReplSet/Mongos and MongoClient.connect
  • Loading branch information
christkv committed Jul 27, 2016
1 parent 63ec4ef commit 6e324a0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/reference/content/upgrade-migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Key features of the 2.1 driver include:

- Redesigned Connection Pool.
- Connection close will drain any outstanding operations.
- replicaSet parameter **MUST** be specified if using MongoClient to connect to replicaset, due to SDAM specification implementation.
- domain support disabled by default, enable with parameter **domainsEnabled** on MongoClient or on the Server/ReplSet/Mongos.

# What's New in 2.1

Expand Down
3 changes: 2 additions & 1 deletion lib/mongos.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var release = os.release();
, 'sslCA', 'sslCert', 'sslKey', 'sslPass', 'socketOptions', 'bufferMaxEntries'
, 'store', 'auto_reconnect', 'autoReconnect', 'emitError'
, 'keepAlive', 'noDelay', 'connectTimeoutMS', 'socketTimeoutMS'
, 'loggerLevel', 'logger', 'reconnectTries', 'appname'];
, 'loggerLevel', 'logger', 'reconnectTries', 'appname', 'domainsEnabled'];

/**
* Creates a new Mongos instance
Expand All @@ -77,6 +77,7 @@ var release = os.release();
* @param {number} [options.socketOptions.keepAlive=0] TCP KeepAlive on the socket with a X ms delay before start.
* @param {number} [options.socketOptions.connectTimeoutMS=0] TCP Connection timeout setting
* @param {number} [options.socketOptions.socketTimeoutMS=0] TCP Socket timeout setting
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @fires Mongos#connect
* @fires Mongos#ha
* @fires Mongos#joined
Expand Down
3 changes: 2 additions & 1 deletion lib/replset.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var legalOptionNames = ['ha', 'haInterval', 'replicaSet', 'rs_name', 'secondaryA
, 'sslCA', 'sslCert', 'sslKey', 'sslPass', 'socketOptions', 'bufferMaxEntries'
, 'store', 'auto_reconnect', 'autoReconnect', 'emitError'
, 'keepAlive', 'noDelay', 'connectTimeoutMS', 'socketTimeoutMS', 'strategy', 'debug'
, 'loggerLevel', 'logger', 'reconnectTries', 'appname'];
, 'loggerLevel', 'logger', 'reconnectTries', 'appname', 'domainsEnabled'];

// Get package.json variable
var driverVersion = require(__dirname + '/../package.json').version;
Expand Down Expand Up @@ -82,6 +82,7 @@ var release = os.release();
* @param {number} [options.socketOptions.keepAlive=0] TCP KeepAlive on the socket with a X ms delay before start.
* @param {number} [options.socketOptions.connectTimeoutMS=10000] TCP Connection timeout setting
* @param {number} [options.socketOptions.socketTimeoutMS=0] TCP Socket timeout setting
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @fires ReplSet#connect
* @fires ReplSet#ha
* @fires ReplSet#joined
Expand Down
3 changes: 2 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var release = os.release();
, 'store', 'auto_reconnect', 'autoReconnect', 'emitError'
, 'keepAlive', 'noDelay', 'connectTimeoutMS', 'socketTimeoutMS'
, 'loggerLevel', 'logger', 'reconnectTries', 'reconnectInterval', 'monitoring'
, 'appname'];
, 'appname', 'domainsEnabled'];

/**
* Creates a new Server instance
Expand All @@ -77,6 +77,7 @@ var release = os.release();
* @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
* @param {number} [options.monitoring=true] Triggers the server instance to call ismaster
* @param {number} [options.haInterval=10000] The interval of calling ismaster when monitoring is enabled.
* @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
* @fires Server#connect
* @fires Server#close
* @fires Server#error
Expand Down
5 changes: 4 additions & 1 deletion test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ var testFiles = [
, '/test/functional/reconnect_tests.js',

// Bug tests
, '/test/functional/jira_bug_tests.js'
, '/test/functional/jira_bug_tests.js',

// Domain tests
, '/test/functional/domain_tests.js'
]

// Check if we support es6 generators
Expand Down

0 comments on commit 6e324a0

Please sign in to comment.