{"record":{"id":"3a1052b937593d96","repo":"vectordotdev/vector","slug":"static","errorCode":null,"errorMessage":"static","messagePattern":"static","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/sinks/loki/sink.rs","lineNumber":556,"sourceCode":"                remove_timestamp: config.remove_timestamp,\n            },\n            batch_settings: validated.batch_settings,\n            out_of_order_action: config.out_of_order_action,\n            service,\n            protocol,\n        })\n    }\n\n    async fn run_inner(self: Box<Self>, input: BoxStream<'_, Event>) -> Result<(), ()> {\n        let mut encoder = self.encoder.clone();\n        let mut filter = RecordFilter::new(self.out_of_order_action);\n\n        // out_of_order_action's that require a complete ordering are limited to building 1 request\n        // at a time\n        let request_builder_concurrency = match self.out_of_order_action {\n            OutOfOrderAction::Accept => default_request_builder_concurrency_limit(),\n            OutOfOrderAction::Drop | OutOfOrderAction::RewriteTimestamp => {\n                NonZeroUsize::new(1).expect(\"static\")\n            }\n        };\n        let batch_settings = self.batch_settings;\n\n        input\n            .map(|event| encoder.encode_event(event))\n            .filter_map(|event| async { event })\n            .map(|record| filter.filter_record(record))\n            .batched_partitioned(RecordPartitioner, batch_settings.timeout, |_| {\n                batch_settings.as_byte_size_config()\n            })\n            .filter_map(|(partition, batch)| async {\n                if let Some(partition) = partition {\n                    let mut count: usize = 0;\n                    let result = batch\n                        .into_iter()\n                        .flatten()\n                        .map(|event| {","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/loki/sink.rs#L538-L574","documentation":"run_inner limits the Loki sink to a single concurrent request builder when out_of_order_action is Drop or RewriteTimestamp. It builds NonZeroUsize::new(1) and unwraps with expect(\"static\"), since 1 is trivially non-zero. This is a compile-time-true invariant; the panic cannot occur at runtime.","triggerScenarios":"Not triggerable — NonZeroUsize::new(1) always returns Some. The expect exists to satisfy the type system for a hardcoded constant.","commonSituations":"None for users; would only appear if the literal 1 were changed to 0 in a code modification.","solutions":["No user action required.","If seen, check for modified source where the constant was changed from 1 to 0."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No action needed — the value is a hardcoded non-zero constant.","Avoid source modifications that alter request-builder concurrency constants."],"tags":["rust","panic","loki","concurrency","sink"],"backgroundTag":"internal-invariant-violation","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}