{"record":{"id":"4da233376e4a4583","repo":"zed-industries/zed","slug":"failed-to-initialize-timer-loop","errorCode":null,"errorMessage":"Failed to initialize timer loop!","messagePattern":"Failed to initialize timer loop!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/dispatcher.rs","lineNumber":59,"sourceCode":"                    .spawn(move || {\n                        for runnable in receiver.iter() {\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                    })\n                    .unwrap()\n            })\n            .collect::<Vec<_>>();\n\n        let (timer_sender, timer_channel) = calloop::channel::channel::<TimerAfter>();\n        let timer_thread = std::thread::Builder::new()\n            .name(\"Timer\".to_owned())\n            .spawn(move || {\n                let mut event_loop: EventLoop<()> =\n                    EventLoop::try_new().expect(\"Failed to initialize timer loop!\");\n\n                let handle = event_loop.handle();\n                let timer_handle = event_loop.handle();\n                handle\n                    .insert_source(timer_channel, move |e, _, _| {\n                        if let channel::Event::Msg(timer) = e {\n                            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                                        }","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_linux/src/linux/dispatcher.rs#L41-L77","documentation":"LinuxDispatcher::new spawns background worker threads and unwraps thread::Builder::spawn; failure means the OS could not create a thread (RLIMIT_NPROC, cgroup pids.max, memory pressure), so the dispatcher cannot start.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/dispatcher.rs:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise ulimit -u or the systemd TasksMax/pids limit","Check for thread leaks exhausting the process thread budget","Reduce requested worker thread count as a degraded startup mode"],"exampleFix":null,"handlingStrategy":"fallback","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"}