proxy: Add a 30-second timeout for requests in-flight to upstream
It's a little more complicated than that, actually. For the various states that involve reading from, or writing to, the upstream fd, if the amount of time spent in that state is > 30 seconds, we reconnect to the server and resend the request. we also introduce a 15-second reconnect dampener to keep us from stressing things unduly. This may need to be decreased, or turned into an exponential backoff, at some point.
This commit is contained in:
@@ -14,6 +14,12 @@
|
||||
#include "prefetch.h"
|
||||
#endif
|
||||
|
||||
/** UPSTREAM_TIMEOUT
|
||||
* How long ( in ms ) to allow for upstream to respond. If it takes longer
|
||||
* than this, we will cancel the current request-response to them and resubmit
|
||||
*/
|
||||
#define UPSTREAM_TIMEOUT 30 * 1000
|
||||
|
||||
struct proxier {
|
||||
/* The flexnbd wrapper this proxier is attached to */
|
||||
struct flexnbd* flexnbd;
|
||||
|
Reference in New Issue
Block a user