-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Fixes possible issue with GC closing projects #6492
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,7 +108,7 @@ async def user_pressed_disconnect(self) -> None: | |
|
|
||
| await self._registry.set_key_alive(self._resource_key(), 1) | ||
|
|
||
| async def remove_socket_id(self) -> None: | ||
| async def remove_socket_id_after_disconnection(self) -> None: | ||
| _logger.debug( | ||
| "user %s/tab %s removing socket from registry...", | ||
| self.user_id, | ||
|
|
@@ -117,9 +117,9 @@ async def remove_socket_id(self) -> None: | |
| ) | ||
|
|
||
| await self._registry.remove_resource(self._resource_key(), _SOCKET_ID_FIELDNAME) | ||
| await self._registry.set_key_alive( | ||
| self._resource_key(), _get_service_deletion_timeout(self.app) | ||
| ) | ||
| # when the tab is closed the alive key is also removed immediately, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So from my understanding, this issue is somehow connected to session IDs (where there is probably some issue how we work with them cross product/cross tabs) did you test it and are you sure this removal will not cause other side-effect issue? Are you able to reproduce this issue? (its happening so often that I guess it should be reproducable?)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can reproduce this everywhere. Open a project and cose the tab its alive key will still be present in Redis. This makes no sense to me. But I might be wrong.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are not sure, why are you changing it without verifying? What if this change makes the GC more unstable? |
||
| # there is no reason to keep it active | ||
| await self._registry.set_key_alive(self._resource_key(), 1) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the key alive has a TTL. This kind of disconnection happen a lot in a train for example... so I think here you might be messing around with it. Did you test that use-case? |
||
|
|
||
| async def set_heartbeat(self) -> None: | ||
| """Extends TTL to avoid expiration of all resources under this session""" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't why you change the naming of that function.
In effect you are moving logic naming into a deeper location.