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

Improve Secure Channel shutdown (make Encryptor or Decryptor remove itself from the Registry) #5323

Closed
SanjoDeundiak opened this issue Jul 11, 2023 · 0 comments

Comments

@SanjoDeundiak
Copy link
Member

SanjoDeundiak commented Jul 11, 2023

Current behavior

Secure Channel consists of a Encryptor Worker and a Handshake/Decryptor Worker. Currently, the proper way to stop a secure channel is implemented here, so both of the Workers are shutdown in that function. Also, the corresponding entry is removed from the Registry. However, that introduces room for inconsistency since a library user may not know about this function or not have access to it (if they don't have access to the SecureChannels instance). In this case, it's very tempting to use ctx.stop_worker() API and shut down only one of the Workers (probably, Handshake/Decryptor Worker, because we primarily use the Encryptor Address after establishing a Secure Channel) or forget to remove the Registry entry.

Desired behavior

The possibility for that mistake could be avoided if calling ctx.stop_worker() with either Encryptor or Decryptor Address would shut down the Secure Channel properly. To achieve that 2 things are needed:

  1. Make Encryptor and Decryptor shut down each other in their shutdown functions here and here. Which is Improve Secure Channel shutdown (make Encryptor and Decryptor shut down each other) #5322
  2. Make one of these Workers remove its entry from the Registry in its shutdown function. Which is this issue.

We love helping new contributors!
If you have questions or need help as you work on your first Ockam contribution, please leave a comment on this discussion.
If you're looking for other issues to contribute to, checkout this discussion and labels - good first issue or help wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant