Skip to content

Commit

Permalink
Add logs for invalid value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiee committed Nov 26, 2021
1 parent a43e2da commit 07bf8d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/graph/session/GraphSessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/admin/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 07bf8d4

Please sign in to comment.