Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/borg/legacy/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import textwrap
import time
import traceback
from collections import deque
from subprocess import Popen, PIPE

import borg.logger
Expand Down Expand Up @@ -462,8 +463,8 @@ def handle_error(unpacked):
else:
raise self.RPCError(unpacked)

calls = list(calls)
waiting_for = []
calls = deque(calls)
waiting_for = deque()
send_buffer() # Try to send data, as some cases (async_response) will never try to send data otherwise.
try:
while wait or calls:
Expand All @@ -479,7 +480,7 @@ def handle_error(unpacked):
while waiting_for:
try:
unpacked = self.responses.pop(waiting_for[0])
waiting_for.pop(0)
waiting_for.popleft()
handle_error(unpacked)
result = unpacked[RESULT]
if self.borg1_server and cmd in BYTES_RESULT_METHODS:
Expand Down Expand Up @@ -565,7 +566,7 @@ def handle_error(unpacked):
_logger.warning("stderr: " + line.decode().strip())
if w:
while not self.to_send and calls and len(waiting_for) < MAX_INFLIGHT:
args = calls.pop(0)
args = calls.popleft()
self.msgid += 1
waiting_for.append(self.msgid)
self.to_send.push_back(msgpack.packb({MSGID: self.msgid, MSG: cmd, ARGS: args}))
Expand Down
Loading