Skip to content

Commit

Permalink
fix(IMAP): Use a non-round number for socket timeout to decrease race…
Browse files Browse the repository at this point in the history
… conditions where both the server and the client wait for the same time
  • Loading branch information
andris9 committed Oct 30, 2024
1 parent 5df4abe commit 686cd86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imap-core/lib/imap-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const EventEmitter = require('events').EventEmitter;
const packageInfo = require('../../package');
const errors = require('../../lib/errors.js');

const SOCKET_TIMEOUT = 5 * 60 * 1000;
// Shift timeout by 37 seconds (randomly selected by myself, no specific meaning) to
// avoid race conditions where both the client and the server wait for 5 minutes
const SOCKET_TIMEOUT = 5 * 60 * 1000 + 37 * 1000;

/**
* Creates a handler for new socket
Expand Down

0 comments on commit 686cd86

Please sign in to comment.