mirror of https://github.com/citusdata/citus.git
Only delay initial connection packets
parent
667edd9194
commit
e8b4db4236
|
@ -36,7 +36,7 @@ INSERT INTO failover_to_local SELECT i, i::text FROM generate_series(0,20)i;
|
|||
-- even if the connection establishment fails, Citus can
|
||||
-- failover to local exection
|
||||
SET citus.node_connection_timeout TO 400;
|
||||
SELECT citus.mitmproxy('conn.delay(500)');
|
||||
SELECT citus.mitmproxy('conn.connect_delay(500)');
|
||||
mitmproxy
|
||||
---------------------------------------------------------------------
|
||||
|
||||
|
@ -68,7 +68,7 @@ CONTEXT: while executing command on localhost:xxxxx
|
|||
-- if the local execution is disabled, Citus does
|
||||
-- not try to fallback to local execution
|
||||
SET citus.enable_local_execution TO false;
|
||||
SELECT citus.mitmproxy('conn.delay(500)');
|
||||
SELECT citus.mitmproxy('conn.connect_delay(500)');
|
||||
mitmproxy
|
||||
---------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class ActionsMixin:
|
|||
return self.next
|
||||
|
||||
def connect_delay(self, timeMs):
|
||||
self.next = DelayHandler(self.root, timeMs)
|
||||
self.next = ConnectDelayHandler(self.root, timeMs)
|
||||
return self.next
|
||||
|
||||
class AcceptHandler(Handler):
|
||||
|
@ -174,8 +174,8 @@ class CancelHandler(Handler):
|
|||
time.sleep(0.1)
|
||||
return 'done'
|
||||
|
||||
class DelayHandler(Handler):
|
||||
'Delay a packet by sleeping before deciding what to do'
|
||||
class ConnectDelayHandler(Handler):
|
||||
'Delay the initial packet by sleeping before deciding what to do'
|
||||
def __init__(self, root, timeMs):
|
||||
super().__init__(root)
|
||||
self.timeMs = timeMs
|
||||
|
|
Loading…
Reference in New Issue