zed/crates/collab
Antonio Scandurra 8dd249a7cd Hold room lock through the entirety of a room_transaction
Previously, when the host repeatedly sent `UpdateWorktree` messages,
new guests attempting to join a project would observe a severe slowdown
caused by a database serialization error (e.g., the coherence of the data
would get violated midway through `Database::join_project` due to worktree
entries being mutated as the user joined). Writing entries is pretty fast,
whereas reading all of them for a project can take more than 100ms.
Transactions that failed due to a serialization error are retried, but the guest
would keep retrying until the host finished writing because the guest's read
was slow.

This commit changes the semantics of `room_transaction` to acquire a room
lock before even starting the transaction and holding it all the way after
commit (storing it, as before, in the `RoomGuard`). This ensures that a fast
writer (the host) can't starve a slow reader (the guest), allowing the latter
to make progress by temporarily pausing writes by the former.
2023-02-22 16:04:29 +01:00
..
k8s
migrations Avoid dropping is_complete column for backward compatibility 2023-01-11 13:25:02 -08:00
migrations.sqlite Avoid dropping is_complete column for backward compatibility 2023-01-11 13:25:02 -08:00
src Hold room lock through the entirety of a room_transaction 2023-02-22 16:04:29 +01:00
.env.toml
basic.conf
Cargo.toml collab 0.5.4 2023-01-27 11:07:12 +01:00
README.md

Zed Server

This crate is what we run at https://collab.zed.dev.

It contains our back-end logic for collaboration, to which we connect from the Zed client via a websocket after authenticating via https://zed.dev, which is a separate repo running on Vercel.