Skip to content

Commit

Permalink
fix inactive queue pop from the wrong end
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Jan 31, 2022
1 parent b5a242b commit f1ca659
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spyne/server/twisted/msgpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(self, tpt, max_buffer_size=2 * 1024 * 1024, out_chunk_size=0,
self.idle_timer = None
self.out_chunks = deque()
self.inreq_queue = OrderedDict()
self.inactive_queue = list()
self.inactive_queue = deque()
self.disconnecting = False # FIXME: should we use this to raise an
# invalid connection state exception ?

Expand Down Expand Up @@ -163,7 +163,7 @@ def connectionMade(self):
self.idle_timer = None
self.out_chunks = deque()
self.inreq_queue = OrderedDict()
self.inactive_queue = list()
self.inactive_queue = deque()
self.active_queue = dict()
self.disconnecting = False # FIXME: should we use this to raise an
# invalid connection state exception ?
Expand Down Expand Up @@ -269,7 +269,7 @@ def process_inactive(self):

if self.max_in_queue_size == 0:
while self.num_inactive_contexts > 0:
p_ctx, others = self.inactive_queue.pop()
p_ctx, others = self.inactive_queue.popleft()
self.active_queue[id(p_ctx)] = p_ctx

self.inreq_queue[id(p_ctx)] = None
Expand All @@ -278,7 +278,7 @@ def process_inactive(self):
else:
while self.num_active_contexts < self.max_in_queue_size and \
self.num_inactive_contexts > 0:
p_ctx, others = self.inactive_queue.pop()
p_ctx, others = self.inactive_queue.popleft()
self.active_queue[id(p_ctx)] = p_ctx

self.inreq_queue[id(p_ctx)] = None
Expand Down

0 comments on commit f1ca659

Please sign in to comment.