From 55c62a79218123094f3eea83ac0b2c6007cf23c2 Mon Sep 17 00:00:00 2001 From: Tommy Brunn Date: Mon, 2 May 2022 10:29:43 +0200 Subject: [PATCH] Enforce request timeout by default Fixes #955 --- src/index.js | 2 +- src/network/connection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 0ef7e4d7f..006844195 100644 --- a/src/index.js +++ b/src/index.js @@ -45,7 +45,7 @@ module.exports = class Client { authenticationTimeout, reauthenticationThreshold, requestTimeout, - enforceRequestTimeout = false, + enforceRequestTimeout = true, retry, socketFactory = defaultSocketFactory(), logLevel = INFO, diff --git a/src/network/connection.js b/src/network/connection.js index 4e3bf76de..d2aa20e97 100644 --- a/src/network/connection.js +++ b/src/network/connection.js @@ -65,7 +65,7 @@ module.exports = class Connection { sasl = null, clientId = 'kafkajs', connectionTimeout, - enforceRequestTimeout = false, + enforceRequestTimeout = true, maxInFlightRequests = null, instrumentationEmitter = null, }) {