{"record":{"id":"6d09bd211737dc21","repo":"zed-industries/zed","slug":"failed-to-spawn-threaded-dispatcher-timer","errorCode":null,"errorMessage":"failed to spawn threaded dispatcher timer","messagePattern":"failed to spawn threaded dispatcher timer","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui/src/platform/threaded_dispatcher.rs","lineNumber":198,"sourceCode":"                        // `run_until_idle` will wait for. Lock order is always\n                        // timer state, then in-flight count; `run_until_idle`\n                        // never takes them in the opposite order.\n                        idle.increment();\n                        drop(state);\n\n                        {\n                            let _decrement = idle.decrement_on_drop();\n                            let location = entry.runnable.metadata().location;\n                            let spawned = entry.runnable.metadata().spawned;\n                            profiler::update_running_task(spawned, location);\n                            entry.runnable.run();\n                            profiler::save_task_timing();\n                        }\n\n                        state = timers.state.lock();\n                    }\n                })\n                .expect(\"failed to spawn threaded dispatcher timer\");\n        }\n\n        Self {\n            background_sender,\n            main_sender,\n            main_receiver: Mutex::new(main_receiver),\n            timers,\n            idle,\n            main_thread_id: thread::current().id(),\n        }\n    }\n\n    /// Runs queued main thread tasks and waits until no background or timer\n    /// work is queued, running, or already due.\n    ///\n    /// Timers that haven't reached their due time yet are *not* waited for:\n    /// the dispatcher runs in real time and cannot skip ahead like the\n    /// `TestDispatcher`'s virtual clock, so waiting on a future timer would","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui/src/platform/threaded_dispatcher.rs#L180-L216","documentation":"ThreadedDispatcher::new fails to spawn its dedicated timer thread; the spawn error (resource exhaustion, thread limits) is unwrapped. Without the timer thread, dispatch_after timers would never fire, so startup fails loudly.","triggerScenarios":"Thrown at crates/gpui/src/platform/threaded_dispatcher.rs:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise process/thread limits (ulimit -u, systemd TasksMax)","Check for thread leaks elsewhere in the application that exhausted the limit","Fall back to running timers on an existing worker thread"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}