{"record":{"id":"b91c5c083500cea2","repo":"risingwavelabs/risingwave","slug":"failed-to-parse-rw-deadlock-detection","errorCode":null,"errorMessage":"Failed to parse RW_DEADLOCK_DETECTION","messagePattern":"Failed to parse RW_DEADLOCK_DETECTION","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/utils/runtime/src/lib.rs","lineNumber":113,"sourceCode":"                .expect(\"Failed to parse TOKIO_WORKER_THREADS\"),\n            Err(std::env::VarError::NotPresent) => std::thread::available_parallelism()\n                .expect(\"Failed to get available parallelism\")\n                .get(),\n            Err(_) => panic!(\"Failed to parse TOKIO_WORKER_THREADS\"),\n        };\n        if worker_threads < MIN_WORKER_THREADS {\n            tracing::warn!(\n                \"the default number of worker threads ({worker_threads}) is too small, which may lead to issues, increasing to {MIN_WORKER_THREADS}\"\n            );\n            // safety: single-threaded now.\n            unsafe { std::env::set_var(\"TOKIO_WORKER_THREADS\", MIN_WORKER_THREADS.to_string()) };\n        }\n    }\n\n    if let Ok(enable_deadlock_detection) = std::env::var(\"RW_DEADLOCK_DETECTION\") {\n        let enable_deadlock_detection = enable_deadlock_detection\n            .parse()\n            .expect(\"Failed to parse RW_DEADLOCK_DETECTION\");\n        if enable_deadlock_detection {\n            enable_parking_lot_deadlock_detection();\n        }\n    } else {\n        // In case the env variable is not set\n        if cfg!(debug_assertions) {\n            enable_parking_lot_deadlock_detection();\n        }\n    }\n\n    if let Ok(profile_path) = std::env::var(\"RW_PROFILE_PATH\") {\n        spawn_prof_thread(profile_path);\n    }\n\n    let future_with_shutdown = async move {\n        let shutdown = CancellationToken::new();\n        let mut fut = pin!(f(shutdown.clone()));\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/utils/runtime/src/lib.rs#L95-L131","documentation":"`RW_DEADLOCK_DETECTION` is parsed as bool via `.expect(\"Failed to parse RW_DEADLOCK_DETECTION\")` in init_tokio_runtime. Any value that is not `true`/`false` (Rust bool parsing) panics the process at startup. When unset, a debug-assertions-dependent default is applied instead.","triggerScenarios":"RW_DEADLOCK_DETECTION set to anything other than exactly \"true\" or \"false\" (e.g. \"1\", \"yes\", \"on\", \"True\", \"\") while launching any RisingWave binary.","commonSituations":"Operators copying env conventions from other services where booleans are 1/0 or on/off; YAML/ConfigMap values like \"enabled\"; locale casing mistakes; accidentally exporting the var empty.","solutions":["Set RW_DEADLOCK_DETECTION=true or RW_DEADLOCK_DETECTION=false (exact lowercase spelling) or unset the variable to use the default.","Search deployment manifests for the variable and normalize casing/format.","If you need 1/0 semantics, transform the value in your entrypoint wrapper script instead."],"exampleFix":"// before (unparseable bool)\nRW_DEADLOCK_DETECTION=1\n// after\nRW_DEADLOCK_DETECTION=true","handlingStrategy":"validation","validationCode":"match std::env::var(\"RW_DEADLOCK_DETECTION\") {\n    Ok(v) if v == \"true\" || v == \"false\" => {},\n    Err(std::env::VarError::NotPresent) => {},\n    other => panic!(\"RW_DEADLOCK_DETECTION must be 'true' or 'false', got {:?}\", other),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact lowercase true/false in all env configuration.","Document boolean env vars with their accepted literals in runbooks.","Sanitize values in helm charts/ConfigMaps before they reach the container env."],"tags":["rust","env-var","parsing","boolean","startup"],"backgroundTag":"invalid-env-var-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}