{"record":{"id":"aed8a808bde8219a","repo":"sgl-project/sglang","slug":"manually-stop-is-only-supported-yet","errorCode":null,"errorMessage":"manually stop is only supported yet","messagePattern":"manually stop is only supported yet","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/profile_utils.py","lineNumber":142,"sourceCode":"            with_stack=with_stack,\n            record_shapes=record_shapes,\n            output_dir=output_dir,\n            output_prefix=profile_prefix,\n            profile_id=profile_id,\n        )\n\n        self.stage_based_trigger.configure(\n            num_steps=num_steps,\n            interesting_stages=profile_stages or [\"prefill\", \"decode\"],\n        )\n\n        return ProfileReqOutput(success=True, message=\"Succeeded\")\n\n    def manual_start(self):\n        raise NotImplementedError(\"manually start is only supported yet\")\n\n    def manual_stop(self):\n        raise NotImplementedError(\"manually stop is only supported yet\")\n\n    def _do_start(self, stage: Optional[str] = None):\n        logger.info(\n            f\"Profiling starts{f' for {stage}' if stage else ''}. \"\n            f\"Traces will be saved to: {self.profiler_kwargs['output_dir']} \"\n            f\"(with profile id: {self.profiler_kwargs['profile_id']})\",\n        )\n\n        assert self.profiler is None\n        # Fold the per-phase c_/g_ aggregates into the step span while this\n        # stage's profile is active (v2 auto-start path; reset in _do_stop).\n        set_detailed_annotations_enabled(self.detailed_annotations)\n        self.profiler = _ProfilerBase.create(\n            **self.profiler_kwargs,\n            ps=self.ps,\n            cpu_group=self.cpu_group,\n            first_rank_in_node=self.first_rank_in_node,\n            output_suffix=f\"-{stage}\" if stage else \"\",","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/profile_utils.py#L124-L160","documentation":"Companion stub to manual_start: manual_stop raises NotImplementedError because only the automatic stop path is implemented in this profiler implementation.","triggerScenarios":"A /stop_profile request in manual mode, or direct profiler.manual_stop() calls.","commonSituations":"Clients that started profiling automatically but attempt a manual stop; scripts assuming start/stop symmetry that doesn't exist yet.","solutions":["Use the automatic stop flow (default _stop_profile)","Upgrade sglang and check whether manual stop landed","Catch NotImplementedError in tooling and degrade gracefully"],"exampleFix":"# before\nprofiler.manual_stop()\n# after\nresult = await profiler.stop()  # automatic path","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"try:\n    profiler.manual_stop()\nexcept NotImplementedError:\n    await profiler.stop()","preventionTips":["Use the automatic stop path","Feature-detect manual mode before exposing it","Wrap profiling control APIs in adapters that absorb NotImplementedError"],"tags":["profiling","not-implemented","sglang"],"backgroundTag":"unsupported-feature-invoked","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}