Skip to content

Commit 5755eb5

Browse files
committed
significantly increase the conat timeouts
- due to clients causing too heavy of load when restarting servers, etc.
1 parent 96adb79 commit 5755eb5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/packages/backend/conat/test/socket/restarts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ beforeAll(async () => {
1818
setDefaultTimeouts({ request: 750, publish: 750 });
1919
});
2020

21-
jest.setTimeout(15000);
21+
jest.setTimeout(25000);
2222

2323
describe("create a client and server and socket, verify it works, restart conat server, then confirm that socket still works", () => {
2424
const SUBJECT = "reconnect.one";

src/packages/conat/core/client.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,13 @@ const MAX_HEADER_SIZE = 100000;
303303
const STATS_LOOP = 5000;
304304

305305
// fairly long since this is to avoid leaks, not for responsiveness in the UI.
306-
export const DEFAULT_SUBSCRIPTION_TIMEOUT = 60000;
306+
export const DEFAULT_SUBSCRIPTION_TIMEOUT = 60_000;
307307

308-
export let DEFAULT_REQUEST_TIMEOUT = 7500;
309-
export let DEFAULT_PUBLISH_TIMEOUT = 7500;
308+
// long so servers don't get DOS's on startup, etc. Also, we use interest-based
309+
// checks when publish and request fail, so we're not depending on these to
310+
// fail as part of the normal startup process for anything.
311+
export let DEFAULT_REQUEST_TIMEOUT = 30_000;
312+
export let DEFAULT_PUBLISH_TIMEOUT = 30_000;
310313

311314
export function setDefaultTimeouts({
312315
request = DEFAULT_REQUEST_TIMEOUT,

0 commit comments

Comments
 (0)