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

CancelledError not handled properly #48

Open
mkiesel opened this issue Nov 16, 2023 · 0 comments
Open

CancelledError not handled properly #48

mkiesel opened this issue Nov 16, 2023 · 0 comments

Comments

@mkiesel
Copy link

mkiesel commented Nov 16, 2023

asyncio.exceptions.CancelledError should get handled properly (i.e., get raised to the calling code).
At the moment, e.g.,

try:
result = await asyncio.wait_for(self.loop.run_in_executor(None, receive_func), timeout=timeout + delta)
except asyncio.TimeoutError:
logger.critical(f"Tonlib #{self.ls_index:03d} stuck (timeout error)")
self._state = "stuck"
except:
logger.critical(f"Tonlib #{self.ls_index:03d} crashed: {traceback.format_exc()}")
self._state = "crashed"

marks the worker as "crashed" instead, which makes it difficult for outside code to stop gracefully.

gromgull added a commit to gromgull/pytonlib that referenced this issue Dec 15, 2023
gromgull added a commit to gromgull/pytonlib that referenced this issue Dec 15, 2023
gromgull added a commit to gromgull/pytonlib that referenced this issue Dec 15, 2023
mariusfeldmann pushed a commit to gromgull/pytonlib that referenced this issue Jun 25, 2024
mariusfeldmann pushed a commit to gromgull/pytonlib that referenced this issue Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant