Compare commits

...

7 Commits

Author SHA1 Message Date
Shilpa Seshadri
8c99132287 Fix build failure 2019-11-13 23:14:08 -08:00
Shilpa Seshadri
680b0471ab Merge branch 'ifcdown' of https://github.com/bill1600/parodus into event_handler 2019-11-13 19:35:30 -08:00
Shilpa Seshadri
4bd5223f08 Merge branch 'master' of https://github.com/Comcast/parodus into event_handler 2019-11-13 18:41:20 -08:00
shilpa24balaji
c7c6fb4926 Merge pull request #328 from bill1600/nosig9
Nosig9
2019-11-12 10:30:59 -08:00
Bill Williams
f4b2c252ae update changelog for nosig9 2019-11-12 10:18:40 -08:00
Bill Williams
8794ce2092 dont try to install handler for signal 9 2019-11-12 10:17:01 -08:00
Shilpa Seshadri
9a2613c0da Invoke conn_close only from main thread 2019-11-04 23:18:50 -08:00
4 changed files with 16 additions and 11 deletions

View File

@@ -22,7 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Update retry timestamp in connection-health-file
- fix so that parodus can be killed, even if in a connection fail loop
- provide signal handlers so we shut down properly when INCLUDE_BREAKPAD active
- send status code and reason in websocket close message
- send status code and reason in websocket close message
- dont try to install handler for signal 9
## [1.0.2] - 2019-02-08
- Refactored connection.c and updated corresponding unit tests

View File

@@ -169,10 +169,11 @@ void createSocketConnection(void (* initKeypress)())
seshat_registered = __registerWithSeshat();
}
// If interface down event is set, wait till interface is up again.
if (get_interface_down_event ())
if (0 != wait_while_interface_down ())
break;
if(get_close_retry())
{
ParodusInfo("close_retry is %d, hence closing the connection and retrying\n", get_close_retry());

View File

@@ -610,6 +610,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx,
if (rtn == CONN_WAIT_ACTION_RETRY) // if redirected or build_headers
continue;
// If interface down event is set, stop retry
// and wait till interface is up again.
if(get_interface_down_event()) {
@@ -625,6 +626,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx,
!= BACKOFF_DELAY_TAKEN) // shutdown or cond wait error
return false;
}
if (rtn == CONN_WAIT_RETRY_DNS)
return false; //find_server again
// else retry
@@ -641,18 +643,19 @@ int wait_while_interface_down()
close_and_unref_connection (get_global_conn());
set_global_conn(NULL);
pthread_mutex_lock(get_interface_down_mut());
while (!get_interface_down_event ()) {
while (get_interface_down_event ()) {
pthread_mutex_lock(get_interface_down_mut());
rtn = pthread_cond_wait(get_interface_down_con(), get_interface_down_mut());
pthread_mutex_unlock (get_interface_down_mut());
if (rtn != 0)
ParodusError
("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
if ((rtn != 0) || g_shutdown) {
pthread_mutex_unlock (get_interface_down_mut());
ParodusError("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
if ((rtn != 0) || g_shutdown)
return -1;
}
}
pthread_mutex_unlock (get_interface_down_mut());
return 0;
}
@@ -697,6 +700,7 @@ int createNopollConnection(noPollCtx *ctx)
set_current_server (&conn_ctx);
if (keep_trying_to_connect (&conn_ctx, &backoff_timer))
break;
// retry dns query
}

View File

@@ -82,7 +82,6 @@ int main( int argc, char **argv)
signal(SIGINT, sig_handler);
signal(SIGUSR1, sig_handler);
signal(SIGUSR2, sig_handler);
signal(SIGKILL, sig_handler);
signal(SIGQUIT, sig_handler);
signal(SIGHUP, sig_handler);
signal(SIGALRM, sig_handler);