spacejam / sled

the champagne of beta embedded databases
Apache License 2.0
8.17k stars 383 forks source link

Deadlock under high load #1412

Open justinlovinger opened 2 years ago

justinlovinger commented 2 years ago

I have an application making hundreds of get calls and dozens of insert calls a second over 8 concurrent threads. Sled consistently deadlocks after several minutes of this. I wasn't able to trigger a deadlock without insert calls, but get calls themselves did deadlock.

Mnwa commented 2 years ago

Hey! I have same problems :( Any chance to fix this?

dariusc93 commented 2 years ago

Since sled is using parking lot, enable their deadlock detection feature and run the small code in a separate thread to detect the deadlock, you could post where it is occurring at.

spacejam commented 2 years ago

please post a stacktrace

robatipoor commented 8 months ago

I encountered a deadlock problem under high concurrent insertions and removals from the database when using the flush_async method. I believe the issue stemmed from the parking_lot crate. After updating to version '0.12.1', the problem has been resolved.

cloutiertyler commented 7 months ago

We're getting a deadlock on a futex while only doing sequential single-threaded get calls. Reproduces after a few seconds of trying to run our script.

From strace: futex(0x7f06b3781bd0, FUTEX_WAIT_PRIVATE, 1, NULL