Skip to content

Commit

Permalink
Problem: zproxy still hangs on slow architectures
Browse files Browse the repository at this point in the history
Solution: send with ZFRAME_DONTWAIT when expecting a send failure, as
the pipe might not exist which means the send, without a timeout, will
get stuck forever waiting for a pipe to appear.
  • Loading branch information
bluca committed Sep 4, 2017
1 parent 51faced commit 338ce26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/zproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,11 @@ s_can_connect (zactor_t **proxy, zsock_t **faucet, zsock_t **sink, const char *f
assert (streq (hello, "Hello, World"));
zstr_free (&hello);
}
zstr_send (*faucet, "Hello, World");
zframe_t *frame = zframe_from ("Hello, World");
rc = zframe_send (&frame, *faucet, expect_success ? 0 : ZFRAME_DONTWAIT);
assert (rc == 0 || !expect_success);
if (!expect_success && rc == -1)
zframe_destroy (&frame);

zpoller_t *poller = zpoller_new (*sink, NULL);
assert (poller);
Expand Down

0 comments on commit 338ce26

Please sign in to comment.