{"record":{"id":"a6cb9e1f1e868ea1","repo":"zed-industries/zed","slug":"failed-to-start-timer-thread","errorCode":null,"errorMessage":"Failed to start timer thread","messagePattern":"Failed to start timer thread","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/dispatcher.rs","lineNumber":84,"sourceCode":"                            let mut runnable = Some(timer.runnable);\n                            timer_handle\n                                .insert_source(\n                                    calloop::timer::Timer::from_duration(timer.duration),\n                                    move |_, _, _| {\n                                        if let Some(runnable) = runnable.take() {\n                                            let location = runnable.metadata().location;\n                                            let spawned = runnable.metadata().spawned;\n                                            profiler::update_running_task(spawned, location);\n                                            runnable.run();\n                                            profiler::save_task_timing();\n                                        }\n                                        TimeoutAction::Drop\n                                    },\n                                )\n                                .expect(\"Failed to start timer\");\n                        }\n                    })\n                    .expect(\"Failed to start timer thread\");\n\n                event_loop.run(None, &mut (), |_| {}).log_err();\n            })\n            .unwrap();\n\n        background_threads.push(timer_thread);\n\n        Self {\n            main_sender,\n            timer_sender,\n            background_sender,\n            _background_threads: background_threads,\n            main_thread_id: thread::current().id(),\n        }\n    }\n}\n\nimpl PlatformDispatcher for LinuxDispatcher {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_linux/src/linux/dispatcher.rs#L66-L102","documentation":"The nested timer_handle.insert_source for each delayed runnable panics on error: calloop could not register the one-shot timer source (typically fd exhaustion or event-loop state issues), so the delayed task would never run and the failure is escalated.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/dispatcher.rs:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check ulimit -n for file descriptor exhaustion from many pending timers","Verify the timer event loop handle is alive and dispatching","Batch timers via a single source/heap instead of one source per timer"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}