diff --git a/src/graph/session/GraphSessionManager.cpp b/src/graph/session/GraphSessionManager.cpp index a5faa5c22b5..c11003d9eb1 100644 --- a/src/graph/session/GraphSessionManager.cpp +++ b/src/graph/session/GraphSessionManager.cpp @@ -151,7 +151,10 @@ void GraphSessionManager::threadFunc() { // TODO(dutor) Now we do a brute-force scanning, of course we could make it more // efficient. void GraphSessionManager::reclaimExpiredSessions() { + DCHECK_GT(FLAGS_session_idle_timeout_secs, 0); if (FLAGS_session_idle_timeout_secs == 0) { + LOG(ERROR) << "Program should not reach here, session_idle_timeout_secs should be an integer " + "between 1 and 604800"; return; } diff --git a/tests/admin/test_configs.py b/tests/admin/test_configs.py index 3baaedba9ec..600d4f0eee2 100644 --- a/tests/admin/test_configs.py +++ b/tests/admin/test_configs.py @@ -37,6 +37,8 @@ def test_configs(self): self.check_resp_succeeded(resp) # update flag to an invalid value, expected to fail + resp = self.client.execute('UPDATE CONFIGS graph:session_idle_timeout_secs={}'.format(0)) + self.check_resp_failed(resp) resp = self.client.execute('UPDATE CONFIGS graph:session_idle_timeout_secs={}'.format(999999)) self.check_resp_failed(resp)