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

[7.12.1] AssertionError in RestManager.stop() #7216

Closed
kozlovsky opened this issue Dec 12, 2022 · 1 comment · Fixed by #7217
Closed

[7.12.1] AssertionError in RestManager.stop() #7216

kozlovsky opened this issue Dec 12, 2022 · 1 comment · Fixed by #7217
Milestone

Comments

@kozlovsky
Copy link
Contributor

kozlovsky commented Dec 12, 2022

Sometimes AssertionError raises in RestManager.stop():

async def stop(self):
    ...
    if self.site:
        await self.site.stop()

The actual error happens in aiohttp.web_request.BaseRequest.__init__:

transport = self._protocol.transport
assert transport is not None

It seems that calling await self.site.stop() is not sufficient for a proper AIOHTTP shutdown, and the correct shutdown code should be:

await self.runner.shutdown()  # should be called before self.runner.cleanup()
await self.runner.cleanup()  # self.site.stop() is called inside this method
@kozlovsky kozlovsky added this to the 7.13.0 milestone Dec 12, 2022
@sentry-for-tribler
Copy link

Sentry issue: TRIBLER-119

kozlovsky added a commit to kozlovsky/tribler that referenced this issue Dec 12, 2022
kozlovsky added a commit to kozlovsky/tribler that referenced this issue Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant