[TRAFODION-1823] ESP idle timeout does not kick in, leading to too many ESPs on the system
Close message from the master was not sent to ESP by the platform agnostic messaging layer in Trafodion. Fixed this bug and then ESP idle time works as expected. ESP_IDLE_TIMEOUT can now be given as a CQD. Internally, it would be changed to SET SESSION DEFAULT and used by the IPC layer of Trafodion. ESP_IDLE_TIMEOUT is set to 30 minutes by default in the CQD too. Added test in core/TESTRTS to test ESP_IDLE_TIMEOUT Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/87eb0347 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/87eb0347 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/87eb0347 Branch: refs/heads/master Commit: 87eb03471199117c6f6585b255d430ef1325dcc7 Parents: 4dda119 Author: selvaganesang <[email protected]> Authored: Tue Mar 29 21:37:05 2016 +0000 Committer: selvaganesang <[email protected]> Committed: Tue Mar 29 21:37:05 2016 +0000 ---------------------------------------------------------------------- core/sqf/src/seabed/src/fs.cpp | 3 +- core/sql/executor/ex_control.cpp | 6 + core/sql/regress/core/EXPECTEDRTS | 1436 +++++++++++++++++--------------- core/sql/regress/core/FILTERRTS | 2 + core/sql/regress/core/TESTRTS | 24 +- core/sql/sqlcomp/nadefaults.cpp | 2 +- 6 files changed, 804 insertions(+), 669 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/87eb0347/core/sqf/src/seabed/src/fs.cpp ---------------------------------------------------------------------- diff --git a/core/sqf/src/seabed/src/fs.cpp b/core/sqf/src/seabed/src/fs.cpp index 50ee423..88e1290 100644 --- a/core/sqf/src/seabed/src/fs.cpp +++ b/core/sqf/src/seabed/src/fs.cpp @@ -737,6 +737,7 @@ SB_Export short BFILE_CLOSE_(short pv_filenum, short pv_tapedisposition) { FS_Fd_Type *lp_fd; short lv_fserr; int lv_status; + int lv_refcount; SB_API_CTR (lv_zctr, BFILE_CLOSE_); SB_UTRACE_API_ADD2(SB_UTRACE_API_OP_FS_CLOSE, pv_filenum); @@ -756,7 +757,7 @@ SB_Export short BFILE_CLOSE_(short pv_filenum, short pv_tapedisposition) { if (pv_filenum == gv_fs_receive_fn) gv_fs_receive_fn = -1; else { - if (msg_mon_get_ref_count(&lp_fd->iv_phandle) > 1) { + if ((lv_refcount = msg_mon_get_ref_count(&lp_fd->iv_phandle)) > 1 || (lv_refcount == 0)) { // send close message to remote fs_int_fs_file_close(lp_fd); } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/87eb0347/core/sql/executor/ex_control.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ex_control.cpp b/core/sql/executor/ex_control.cpp index d8e62b0..8d99ea5 100644 --- a/core/sql/executor/ex_control.cpp +++ b/core/sql/executor/ex_control.cpp @@ -433,6 +433,12 @@ short ExControlTcb::work() currContext->getSessionDefaults()->setCallEmbeddedArkcmp(FALSE); } } + else if (strcmp(value[1], "ESP_IDLE_TIMEOUT") == 0) + { + int lvl = (int) strtoul(value[2], NULL, 10); + currContext->getSessionDefaults()-> + setEspIdleTimeout(lvl); + } } } }
