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

asyncio.exceptions.InvalidStateError: invalid state #184

Closed
andrewshvv opened this issue Jul 13, 2023 · 1 comment · Fixed by #186
Closed

asyncio.exceptions.InvalidStateError: invalid state #184

andrewshvv opened this issue Jul 13, 2023 · 1 comment · Fixed by #186

Comments

@andrewshvv
Copy link

import aiomisc
import asyncio


class TestService(aiomisc.Service):
    async def start(self):
        # Service is ready
        self.start_event.set()

        while True:
            await asyncio.sleep(1)


with aiomisc.entrypoint(
        TestService(),
        log_level="info",
        log_format="color"
) as loop:
    loop.run_forever()

Stoping service in Pycharm leads to:

2023-07-13 16:29:13 [T:MainThread] ERROR:asyncio.unhandled: Exception in callback <built-in method set_result of _asyncio.Future object at 0x7fa78859e860>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
asyncio.exceptions.InvalidStateError: invalid state
2023-07-13 16:29:13 [T:MainThread] WARNING:aiomisc.entrypoint: Interrupt signal received, shutting down...

Seems like it's not leading to some breaking behaviour, but just curious, can I fix it somehow.

mosquito added a commit that referenced this issue Jul 20, 2023
@mosquito
Copy link
Collaborator

mosquito commented Jul 20, 2023

My bad, that was cycling task cancellation, should be fixed in #186

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

Successfully merging a pull request may close this issue.

2 participants