Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try catching specific UnicodeDecodeError #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 9 additions & 0 deletions adaptive_scheduler/server_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ async def _manage(self) -> None:
"socket.recv_serialized failed in the DatabaseManager"
" with `pickle.UnpicklingError` in _deserialize."
)
except UnicodeDecodeError as e:
if r"\x99" in str(e):
# TODO: Cameron encountered this error
pass
else:
log.exception(
"socket.recv_serialized failed in the DatabaseManager"
" with `UnicodeDecodeError` in _deserialize."
)
else:
self._last_reply = self._dispatch(self._last_request)
await socket.send_serialized(self._last_reply, _serialize)
Expand Down
5 changes: 5 additions & 0 deletions adaptive_scheduler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ def _deserialize(frames):
r"pickle.UnpicklingError in _deserialize: Received an empty frame (\x03)."
)
raise
except UnicodeDecodeError as e:
if r"\x99" in str(e):
# TODO: Cameron encountered this error
print(f"UnicodeDecodeError in _deserialize: Received frame: {frames}.")
raise


class LRUCachedCallable(Callable[..., Any]):
Expand Down