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

Fix race condition when server is only partway added #916

Open
EvanHahn opened this issue Oct 17, 2024 · 0 comments
Open

Fix race condition when server is only partway added #916

EvanHahn opened this issue Oct 17, 2024 · 0 comments
Assignees

Comments

@EvanHahn
Copy link
Contributor

Adding a server peer basically has 3 steps:

  1. Tell the server to add itself to the project.
  2. Assign a role to the server peer.
  3. Wait for an initial sync with the server peer.

A bug can arise if steps 2 or 3 fail, or if step 1 succeeds on the server but fails on the client (likely due to network failure). If this happens, trying to re-add the server will fail because the server will respond with “you can’t do this, we already have this project”.

To fix this, we should:

  • Make adding a project idempotent on the server side. (See the associated issue on comapeo-cloud.)
  • Make assigning the role idempotent in this repo.
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

No branches or pull requests

2 participants