Commit 14df80ae authored by Luca Boccassi's avatar Luca Boccassi

Problem: test_security_curve does not account for ECONNRESET

Solution: ignore ECONNRESET as with EPIPE - it can happen on very
slow machines when the engine sends data to the peer and then tries
to read from the TCP socket before the peer has read
parent dc51ebeb
...@@ -276,8 +276,8 @@ void expect_new_client_curve_bounce_fail (void *ctx, ...@@ -276,8 +276,8 @@ void expect_new_client_curve_bounce_fail (void *ctx,
// expects that one or more occurrences of the expected event are received // expects that one or more occurrences of the expected event are received
// via the specified socket monitor // via the specified socket monitor
// returns the number of occurrences of the expected event // returns the number of occurrences of the expected event
// interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL/EPIPE occurs; // interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL/EPIPE/ECONNRESET
// in this case, 0 is returned // occurs; in this case, 0 is returned
// this should be investigated further, see // this should be investigated further, see
// https://github.com/zeromq/libzmq/issues/2644 // https://github.com/zeromq/libzmq/issues/2644
int expect_monitor_event_multiple (void *server_mon, int expect_monitor_event_multiple (void *server_mon,
...@@ -295,8 +295,11 @@ int expect_monitor_event_multiple (void *server_mon, ...@@ -295,8 +295,11 @@ int expect_monitor_event_multiple (void *server_mon,
!= -1) { != -1) {
timeout = 250; timeout = 250;
// ignore errors with EPIPE, which happen sporadically, see above // ignore errors with EPIPE/ECONNRESET, which happen sporadically
if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL && err == EPIPE) { // ECONNRESET can happen on very slow machines, when the engine writes
// to the peer and then tries to read the socket before the peer reads
if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL &&
(err == EPIPE || err == ECONNRESET)) {
fprintf (stderr, "Ignored event: %x (err = %i)\n", event, err); fprintf (stderr, "Ignored event: %x (err = %i)\n", event, err);
client_closed_connection = 1; client_closed_connection = 1;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment