forked from steveyen/moxi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-2689 - add timeout to moxi SASL auth & bucket select requests
In this change, moxi SASl auth and bucket select are still synchronous, but have additional configurable timeouts (via the downstream_timeout configuration parameter). This is done by adding a select() with timeout mcs_io_read(), which shouldn't be too horrible as SASL auth should be very infrequent due to long-lived, reused connections. The alternative solution of rewriting SASL auth and bucket-select, in comparison, to be asynchronous is a lot of effort. Change-Id: I61f31fb3a4c4a994ff79d6a9f909ca578ae02236 Reviewed-on: http://review.membase.org/3604 Reviewed-by: Sean Lynch <seanl@literati.org> Tested-by: Sean Lynch <seanl@literati.org>
- Loading branch information
Showing
5 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
echo starting moxi... | ||
|
||
# Note, if you removed or zero'ed the timeouts, moxi would also | ||
# (correctly, expectedly) hang at client request 2. | ||
|
||
./moxi -d -P /tmp/moxi-2689-test-moxi.pid \ | ||
-z 11266=127.0.0.1:11277 -t 1 \ | ||
-Z downstream_conn_max=1,downstream_max=0,downstream_timeout=100,wait_queue_timeout=100 | ||
|
||
echo starting memcached simulant... | ||
|
||
./moxi -d -P /tmp/moxi-2689-test-memcached.pid -p 11277 | ||
|
||
echo client request 1 - expect NOT_FOUND | ||
time (echo incr a 1 | nc 127.0.0.1 11266) | ||
|
||
echo stopping memcached simulant... | ||
kill -STOP `cat /tmp/moxi-2689-test-memcached.pid` | ||
|
||
echo client request 2 - hangs in bug MB-2689, instead expect SERVER_ERROR | ||
time (echo incr a 1 | nc 127.0.0.1 11266) | ||
|
||
echo client request 3 - expect SERVER_ERROR | ||
time (echo incr a 1 | nc 127.0.0.1 11266) | ||
|
||
echo client request 4 - expect SERVER_ERROR | ||
time (echo incr a 1 | nc 127.0.0.1 11266) | ||
|
||
echo OK - no more hanging | ||
killall moxi | ||
|