-
-
Notifications
You must be signed in to change notification settings - Fork 882
One singular self._delete_task: remove _num_connections and deprecate prune_instances
#5425
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
The force-pushes are due to incomplete pylint fixes. We can agree that force-push are for "commits you don't want people to see" |
|
Recap on the two reverts: 8414e1d is a bad idea, since it causes a breaking change. Rather, 4ada9e4 makes 1548190 is a bad idea, since when a client is deleted by something other than the self-destruct mechanism, it will leave behind a delete task which does nothing. Ideally, a deleted client should be as dead as a doorknob. In f212c5c I cancel the delete task if the client is deleted, so it really is as dead as a doorknob |
|
@evnchn Today I talked to @rodja about PR #5421 (introducing shared pages). Even though we're definitely going to mark them as experimental with a list of known limitations, they might benefit from the current |
|
We can still simplify the logic while keeping But still I don't think it's worth the effort to do that when #5421 is a "maybe". Let's leave it later. |
Motivation
TL-DR: If you want something to always get cleaned up, clean it up in one place, never switch PICs. Keep logic clean and firm by always cleaning up when the function elapses - only way to stop it is to cancel the function.
So a client should, ideally, self-destruct.
But now a client is destroyed in a variety of places, and only sometimes it actually destroys.
Client.prune_instances_delete_tasks, which can be multiple, but we act on the last one because we only actually delete whenself._num_connections[document_id] == 0This is quite some technical debt (no we are not 🤡 enough to write this on day one). Some left from 2.x when we had auto-index client. This PR seeks to eliminate it.
Implementation
Removals and deprecations:
_num_connections._delete_tasks(plural).Client.prune_instances(does nothing now)Additions
_delete_task. Considering the above, only the last one matter anyways, so why bother.self._reset_self_delete: For share the logic between the existing socket-disconnect self-delete, and the before-connect 60-second self-deleteProgress
Client.prune_instancesthough.