Open dhruvmanila opened 3 weeks ago
A stack trace would be very helpful to understand where this is throwing. This may or may not be a salsa bug.
```
2024-09-02 15:14:54.781 [info] Name: Ruff
2024-09-02 15:14:54.781 [info] Module: ruff
2024-09-02 15:14:54.781 [info] Python extension loading
2024-09-02 15:14:54.781 [info] Waiting for interpreter from python extension.
2024-09-02 15:14:54.840 [info] Python extension loaded
2024-09-02 15:14:54.841 [info] Using interpreter: /Users/dhruv/playground/.venv/bin/python
2024-09-02 15:14:54.854 [info] Using 'path' setting: /Users/dhruv/work/astral/ruff/target/debug/red_knot
2024-09-02 15:14:55.108 [info] Found Ruff 0.0.0 at /Users/dhruv/work/astral/ruff/target/debug/red_knot
2024-09-02 15:14:55.108 [info] Server run command: /Users/dhruv/work/astral/ruff/target/debug/red_knot server
2024-09-02 15:14:55.108 [info] Server: Start requested.
2024-09-02 15:15:00.925 [info] panicked at /Users/dhruv/.cargo/git/checkouts/salsa-61760caba2b17ca5/f608ff8/src/tracked_struct.rs:377:9:
two concurrent writers to Id(3400), should not be possible
2024-09-02 15:15:00.970 [info] 0: std::backtrace_rs::backtrace::libunwind::trace
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
1: std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: std::backtrace::Backtrace::create
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/backtrace.rs:331:13
3: red_knot_server::server::Server::run::{{closure}}
at /Users/dhruv/work/astral/ruff/crates/red_knot_server/src/server.rs:145:29
2024-09-02 15:15:00.970 [info] 4:
Thx. Yeah, I think this is a salsa bug. I wasn't sure if it panics inside of apply_changes
.
Even if this is a Salsa bug, we should probably prioritize tracking it down soon? Seems like a serious issue.
We've reproduced this in Salsa at https://github.com/salsa-rs/salsa/pull/573
Discovered in https://github.com/astral-sh/ruff/pull/13042.
This could very well be a Salsa bug but we need a way to reproduce there reliably.
What am I doing in the video below is to type of
def
and then removing all content from the file and then typingdef
again.https://github.com/user-attachments/assets/502c8bbb-8f7a-47ee-8f76-b9c25cdabf6c