diff options
author | Ali Mir <ali.mir@mongodb.com> | 2021-02-04 21:27:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-05 20:55:30 +0000 |
commit | 857ec7949839102d30b1bf3c82b1437a70970084 (patch) | |
tree | be073a3694da097df4adc7725af04b572b240f9a /jstests/hooks/run_reconfig_background.js | |
parent | 5ee73f447aaa1e1b9503aff6ff031f240708c711 (diff) | |
download | mongo-857ec7949839102d30b1bf3c82b1437a70970084.tar.gz |
SERVER-54184 Check for error message when ignoring ShutdownInProgress errors in run_reconfig_background.js
Diffstat (limited to 'jstests/hooks/run_reconfig_background.js')
-rw-r--r-- | jstests/hooks/run_reconfig_background.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/hooks/run_reconfig_background.js b/jstests/hooks/run_reconfig_background.js index ae3ee237b9a..7318dfc9840 100644 --- a/jstests/hooks/run_reconfig_background.js +++ b/jstests/hooks/run_reconfig_background.js @@ -27,8 +27,12 @@ function isIgnorableError(codeName) { /** * Returns true if the error code indicates the node is currently shutting down. */ -function isShutdownError(code) { - return code === ErrorCodes.ShutdownInProgress || code === ErrorCodes.InterruptedAtShutdown; +function isShutdownError(error) { + // TODO (SERVER-54026): Remove check for error message once the shell correctly + // propagates the error code. + return error.code === ErrorCodes.ShutdownInProgress || + error.code === ErrorCodes.InterruptedAtShutdown || + error.message.includes("The server is in quiesce mode and will shut down"); } /** @@ -149,7 +153,7 @@ try { return regex.test(e.message); })) { jsTestLog("Ignoring replica set monitor error" + tojson(e)); - } else if (isShutdownError(e.code)) { + } else if (isShutdownError(e)) { // It's possible that the primary we passed in gets killed by the kill primary hook. // During shutdown, mongod will respond to incoming hello requests with ShutdownInProgress // or InterruptedAtShutdown. This hook should ignore both cases and wait until we have a |