diff --git a/src/calibre/srv/loop.py b/src/calibre/srv/loop.py index 7414e0a754..a237244902 100644 --- a/src/calibre/srv/loop.py +++ b/src/calibre/srv/loop.py @@ -648,16 +648,8 @@ class ServerLoop(object): if iswindows: self.control_in.sendall(what) else: - try: - self.control_in.write(what) - self.control_in.flush() - except BrokenPipeError: - # this started happening in the CI environment for the ajax_book test - # in early Dec 2020 - self.log.error('Control pipe broken, resetting') - self.create_control_connection() - self.control_in.write(what) - self.control_in.flush() + self.control_in.write(what) + self.control_in.flush() def wakeup(self): self.write_to_control(WAKEUP) diff --git a/src/calibre/srv/tests/ajax.py b/src/calibre/srv/tests/ajax.py index 9828415b7b..67debbec4c 100644 --- a/src/calibre/srv/tests/ajax.py +++ b/src/calibre/srv/tests/ajax.py @@ -7,7 +7,6 @@ __copyright__ = '2015, Kovid Goyal ' import json import os -import time import zlib from functools import partial from io import BytesIO @@ -38,12 +37,7 @@ class ContentTest(LibraryBaseTest): db = server.handler.router.ctx.library_broker.get(None) conn = server.connect() request = partial(make_request, conn, prefix='/ajax/book') - - try: - r, data = request('/x') - except ConnectionRefusedError: - time.sleep(2) - r, data = request('/x') + r, data = request('/x') self.ae(r.status, NOT_FOUND) r, onedata = request('/1')