Skip to content

Commit cc7c75a

Browse files
authored
feat(NODE-5189): deprecate tcp keepalive options (#3621)
1 parent 4b5be21 commit cc7c75a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/cmap/connection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ export interface ConnectionOptions
122122
credentials?: MongoCredentials;
123123
connectTimeoutMS?: number;
124124
tls: boolean;
125+
/** @deprecated - Will not be able to turn off in the future. */
125126
keepAlive?: boolean;
127+
/** @deprecated - Will not be configurable in the future. */
126128
keepAliveInitialDelay?: number;
127129
noDelay?: boolean;
128130
socketTimeoutMS?: number;

src/connection_string.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,13 @@ export const OPTIONS = {
852852
},
853853
keepAlive: {
854854
default: true,
855-
type: 'boolean'
855+
type: 'boolean',
856+
deprecated: 'Will not be able to turn off in the future.'
856857
},
857858
keepAliveInitialDelay: {
858859
default: 120000,
859-
type: 'uint'
860+
type: 'uint',
861+
deprecated: 'Will not be configurable in the future.'
860862
},
861863
loadBalanced: {
862864
default: false,

src/mongo_client.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,12 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
212212
sslCRL?: string;
213213
/** TCP Connection no delay */
214214
noDelay?: boolean;
215-
/** TCP Connection keep alive enabled */
215+
/** @deprecated TCP Connection keep alive enabled. Will not be able to turn off in the future. */
216216
keepAlive?: boolean;
217-
/** The number of milliseconds to wait before initiating keepAlive on the TCP socket */
217+
/**
218+
* @deprecated The number of milliseconds to wait before initiating keepAlive on the TCP socket.
219+
* Will not be configurable in the future.
220+
*/
218221
keepAliveInitialDelay?: number;
219222
/** Force server to assign `_id` values instead of driver */
220223
forceServerObjectId?: boolean;

0 commit comments

Comments
 (0)