Skip to content

Commit 17ac284

Browse files
committed
BF: CS-714 shutting down the listener thread pool takes too long
1 parent b8864ad commit 17ac284

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

source/daemons/qmaster/sge_qmaster_main.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,14 @@ int main(int argc, char *argv[]) {
207207
CRITICAL(SFNMAX, MSG_QMASTER_COMMUNICATION_ERRORS);
208208
sge_exit(1);
209209
}
210-
if (cl_com_get_handle(prognames[QMASTER], 1) == nullptr) {
210+
cl_com_handle *handle = cl_com_get_handle(prognames[QMASTER], 1);
211+
if (handle != nullptr) {
212+
// this is the smallest possible synchron receive timeout
213+
// it is used by listener threads waiting for messages
214+
// the default (5s) seems pretty high, if listener threads pass their main loop once a second in an idle
215+
// system, this shouldn't cause any noticeable load
216+
cl_com_set_synchron_receive_timeout(handle, 1);
217+
} else {
211218
/* sleep when prepare_enroll() failed */
212219
sleep(1);
213220
}

source/daemons/qmaster/sge_qmaster_process_message.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,10 @@ do_c_ack_request(struct_msg_t *message, monitoring_t *monitor) {
203203
void
204204
sge_qmaster_process_message(monitoring_t *monitor) {
205205
int res;
206-
struct_msg_t msg;
206+
struct_msg_t msg{};
207207

208208
DENTER(TOP_LAYER);
209209

210-
memset((void *) &msg, 0, sizeof(struct_msg_t));
211-
212210
/*
213211
* INFO (CR)
214212
*

0 commit comments

Comments
 (0)