)]}'
{"cyborg/accelerator/drivers/nvme/driver.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"d2b43ea978881969a0cf5a0774b1da18d55c826b","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                if status_bits \u003d\u003d 0x1:"},{"line_number":330,"context_line":"                    return"},{"line_number":331,"context_line":"                if status_bits \u003d\u003d 0x3:"},{"line_number":332,"context_line":"                    raise RuntimeError(\u0027Sanitize failed: sstat\u003d%r\u0027 % sstat)"},{"line_number":333,"context_line":"            time.sleep(5)"},{"line_number":334,"context_line":"        raise RuntimeError("},{"line_number":335,"context_line":"            \u0027Sanitize on %s did not complete within %ds\u0027 % (nvme_dev, timeout)"}],"source_content_type":"text/x-python","patch_set":2,"id":"6fed2bb7_6c021bba","line":332,"updated":"2026-08-06 11:16:16.000000000","message":"The _poll_sanitize method raises bare RuntimeError for sanitize failure and timeout conditions instead of using cyborg.common.exception subclasses. This breaks the project convention where all operational errors are represented as CyborgException subclasses, preventing callers from handling clean...\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Callers of NVMeDriver.cleanup() cannot distinguish sanitize failures from other errors using cyborg\u0027s exception hierarchy. Code that expects to catch CyborgException subclasses will not catch RuntimeError, potentially causing unhandled exceptions in the agent cleanup path.\n\n**Suggestion**:\nReplace RuntimeError with appropriate cyborg exception subclasses. For sanitize failure, create or use an existing exception such as a new DeviceCleanupFailed exception extending CyborgException. For timeout, consider using the existing exception patterns with appropriate msg_fmt.","commit_id":"acc375509fcdd0580d5567bd0d7b50e99997e509"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"b8b7819650e3e4dfb089cf9600ccfaf0e8ae56f0","unresolved":false,"context_lines":[{"line_number":358,"context_line":"            for nsid in range(1, nn + 1):"},{"line_number":359,"context_line":"                try:"},{"line_number":360,"context_line":"                    nvme_cli.nvme_delete_ns(nvme_dev, nsid)"},{"line_number":361,"context_line":"                except Exception:"},{"line_number":362,"context_line":"                    LOG.warning(\u0027Failed to delete ns %d on %s\u0027, nsid, nvme_dev)"},{"line_number":363,"context_line":"            tnvmcap \u003d id_ctrl.get(\u0027tnvmcap\u0027, 0)"},{"line_number":364,"context_line":"            nvme_cli.nvme_create_ns(nvme_dev, tnvmcap, tnvmcap)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9331047b_8700f889","line":361,"updated":"2026-08-06 15:24:59.000000000","message":"The _consolidate_namespaces method catches bare Exception around nvme_delete_ns, which violates the OpenStack Hacking/pep8 guidance against overly broad exception handling. The specific expected exception from nvme-cli operations is processutils.ProcessExecutionError.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Swallowing all exceptions during namespace deletion can mask programming errors and leave the device in an inconsistent namespace state before creating a new namespace, potentially causing the subsequent create-ns to fail or the write-zeroes to target the wrong namespace.\n\n**Suggestion**:\nCatch processutils.ProcessExecutionError specifically instead of bare Exception, since nvme_delete_ns wraps nvme-cli via oslo.concurrency processutils.execute which raises ProcessExecutionError on non-zero exit.","commit_id":"c44643b594233cd41e5fbaeb3a6a8cd6322c8f66"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"b8b7819650e3e4dfb089cf9600ccfaf0e8ae56f0","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                except Exception:"},{"line_number":362,"context_line":"                    LOG.warning(\u0027Failed to delete ns %d on %s\u0027, nsid, nvme_dev)"},{"line_number":363,"context_line":"            tnvmcap \u003d id_ctrl.get(\u0027tnvmcap\u0027, 0)"},{"line_number":364,"context_line":"            nvme_cli.nvme_create_ns(nvme_dev, tnvmcap, tnvmcap)"},{"line_number":365,"context_line":"            nvme_cli.nvme_ns_rescan(nvme_dev)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5c01820b_c02e606e","line":364,"updated":"2026-08-06 15:24:59.000000000","message":"In _consolidate_namespaces, the tnvmcap value from id-ctrl (total NVM capacity in bytes) is passed directly as both nsze and ncap to nvme_create_ns. The NVMe Create Namespace command expects nsze and ncap in logical blocks, not bytes, so the resulting namespace will be oversized by a factor of th...\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: On real NVMe hardware, creating a namespace with an nsze orders of magnitude larger than the physical capacity will either fail with an error or create an oversized namespace that may cause I/O errors or undefined behavior when the write-zeroes operation targets blocks beyond the physical medium.\n\n**Suggestion**:\nConvert tnvmcap from bytes to blocks by dividing by the logical block size from id-ns (typically obtained from lba format data). For example: nsze \u003d tnvmcap // lba_data_block_size. Alternatively, query the namespace capacity from the controller after consolidation.","commit_id":"c44643b594233cd41e5fbaeb3a6a8cd6322c8f66"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"79321cc9afabcbd235831a51d61863c8db46a93d","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"            if sprog \u003d\u003d 0xFFFF:"},{"line_number":330,"context_line":"                status_bits \u003d self._parse_sstat(sstat)"},{"line_number":331,"context_line":"                if status_bits \u003d\u003d 0x1:"},{"line_number":332,"context_line":"                    return"},{"line_number":333,"context_line":"                if status_bits \u003d\u003d 0x3:"},{"line_number":334,"context_line":"                    raise exception.DeviceCleanupFailed("}],"source_content_type":"text/x-python","patch_set":5,"id":"b4c30d1c_97038682","line":331,"updated":"2026-08-07 07:26:06.000000000","message":"The _poll_sanitize method treats SSTAT status_bits \u003d\u003d 0x1 as sanitize completion, but the NVMe specification defines SSTAT.SSTAT value 001b as \u0027Sanitize In Progress\u0027. The correct completion values are 010b (2, Completed Successfully) and possibly 000b (0, never sanitized/already clean) and 101b (...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: If SSTAT value 1 (in progress) is interpreted as completion, the poll may return before data is actually erased, leaving sensitive data on the device. Alternatively, when the sanitize truly completes (SSTAT\u003d2), the code will not recognize it and will continue polling until timeout, causing spurio...\n\n**Priority**: Before merge\n**Why This Matters**: If SSTAT value 1 (in progress) is interpreted as completion, the poll may return before data is actually erased, leaving sensitive data on the device. Alternatively, when the sanitize truly completes (SSTAT\u003d2), the code will not recognize it and will continue polling until timeout, causing spurio...\n\n**Recommendation**:\nChange the completion check to match NVMe spec values: treat status_bits in (0x0, 0x2, 0x5) as success (completed or already clean) and status_bits \u003d\u003d 0x3 as failure. Update the test mock data to use sstat\u003d0x2 for the success case.","commit_id":"b6c11c7dabee155d17bc2a0fd10bd4984ca61747"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"79321cc9afabcbd235831a51d61863c8db46a93d","unresolved":false,"context_lines":[{"line_number":345,"context_line":"            self._consolidate_namespaces(nvme_dev)"},{"line_number":346,"context_line":"        ns_dev \u003d nvme_dev + \u0027n1\u0027"},{"line_number":347,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(ns_dev)"},{"line_number":348,"context_line":"        nsze \u003d id_ns.get(\u0027nsze\u0027, 0)"},{"line_number":349,"context_line":"        nvme_cli.nvme_write_zeroes(ns_dev, 1, 0, nsze - 1)"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"    def _do_shred(self, nvme_dev, ns_mgmt):"}],"source_content_type":"text/x-python","patch_set":5,"id":"98f62e1a_12eda317","line":348,"updated":"2026-08-07 07:26:06.000000000","message":"The _do_write_zeroes method computes block_count as nsze - 1, where nsze defaults to 0 via id_ns.get(\u0027nsze\u0027, 0). If the namespace reports nsze\u003d0 or the key is absent from id-ns JSON output, block_count becomes -1, which is passed to the nvme write-zeroes command as a negative count.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: A negative block_count will cause the nvme write-zeroes command to fail or produce undefined behavior. The error propagates as a raw ProcessExecutionError rather than a typed DeviceCleanupFailed exception.\n\n**Suggestion**:\nAdd a guard: if nsze \u003c\u003d 0, raise exception.DeviceCleanupFailed with a descriptive reason. Alternatively, skip write-zeroes and fall back to shred if the namespace size is invalid.","commit_id":"b6c11c7dabee155d17bc2a0fd10bd4984ca61747"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"79321cc9afabcbd235831a51d61863c8db46a93d","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        ns_dev \u003d nvme_dev + \u0027n1\u0027"},{"line_number":347,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(ns_dev)"},{"line_number":348,"context_line":"        nsze \u003d id_ns.get(\u0027nsze\u0027, 0)"},{"line_number":349,"context_line":"        nvme_cli.nvme_write_zeroes(ns_dev, 1, 0, nsze - 1)"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"    def _do_shred(self, nvme_dev, ns_mgmt):"},{"line_number":352,"context_line":"        if ns_mgmt:"}],"source_content_type":"text/x-python","patch_set":5,"id":"e2f8df62_af78233d","line":349,"updated":"2026-08-07 07:26:06.000000000","message":"The _do_write_zeroes method issues a single nvme write-zeroes command covering nsze-1 blocks. The NVMe Write Zeroes command\u0027s NLB (Number of Logical Blocks) field is 16-bit, limiting each command to at most 65536 blocks. Real-world NVMe namespaces have millions of blocks, so a single call cannot...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: For any real-world NVMe namespace, the write-zeroes path will either fail with an error from the controller/driver (causing cleanup failure with an unhelpful ProcessExecutionError rather than DeviceCleanupFailed) or silently truncate, leaving data un-erased on a device that is supposed to be secu...\n\n**Priority**: Before merge\n**Why This Matters**: For any real-world NVMe namespace, the write-zeroes path will either fail with an error from the controller/driver (causing cleanup failure with an unhelpful ProcessExecutionError rather than DeviceCleanupFailed) or silently truncate, leaving data un-erased on a device that is supposed to be secu...\n\n**Recommendation**:\nLoop over the namespace in chunks of at most 65536 blocks, issuing a separate write-zeroes command per chunk. Track the current LBA offset and remaining block count across iterations.","commit_id":"b6c11c7dabee155d17bc2a0fd10bd4984ca61747"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"ee6dc4b448a5767d16f47dd4b0896bf8493b40fc","unresolved":false,"context_lines":[{"line_number":419,"context_line":"            ns_dev \u003d \u0027%sn%d\u0027 % (nvme_dev, nsid)"},{"line_number":420,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(ns_dev)"},{"line_number":421,"context_line":"        namespace_size \u003d id_ns.get(\u0027nsze\u0027, 0)"},{"line_number":422,"context_line":"        nvme_cli.nvme_write_zeroes(ns_dev, 1, 0, namespace_size - 1)"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    def _do_shred(self, nvme_dev, ns_mgmt):"},{"line_number":425,"context_line":"        if ns_mgmt:"}],"source_content_type":"text/x-python","patch_set":7,"id":"cf32aa1b_bd9ce043","line":422,"updated":"2026-08-09 05:33:45.000000000","message":"_do_write_zeroes always passes 1 as the namespace_id argument to nvme_write_zeroes, regardless of which namespace was actually resolved. In the ns_mgmt\u003dFalse path the correct nsid is already available from nvme_list_ns but is not used. In the ns_mgmt\u003dTrue path _consolidate_namespaces returns a de...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: On devices whose first active namespace has an NSID other than 1, the write-zeroes command targets the wrong namespace or fails. This results in incomplete or incorrect device sanitization during cleanup, leaving data on the wrong namespace.\n\n**Priority**: Before merge\n**Why This Matters**: On devices whose first active namespace has an NSID other than 1, the write-zeroes command targets the wrong namespace or fails. This results in incomplete or incorrect device sanitization during cleanup, leaving data on the wrong namespace.\n\n**Recommendation**:\nPass the actual NSID to nvme_write_zeroes. In the ns_mgmt\u003dFalse path use the already-computed nsid. In the ns_mgmt\u003dTrue path, have _consolidate_namespaces return both the device path and the NSID, or extract the NSID from the returned path.","commit_id":"e5a7877ab9432515f4b22721a94b5af374abf44f"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"ee6dc4b448a5767d16f47dd4b0896bf8493b40fc","unresolved":false,"context_lines":[{"line_number":458,"context_line":"            except Exception:"},{"line_number":459,"context_line":"                LOG.warning(\u0027Failed to delete ns %d on %s\u0027, nsid, nvme_dev)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        nvme_cli.nvme_create_ns("},{"line_number":462,"context_line":"            nvme_dev, lba_count, lba_count, active_lba_format \u0026 0xF"},{"line_number":463,"context_line":"        )"},{"line_number":464,"context_line":"        nvme_cli.nvme_ns_rescan(nvme_dev)"}],"source_content_type":"text/x-python","patch_set":7,"id":"e99f77bf_54398f02","line":461,"updated":"2026-08-09 05:33:45.000000000","message":"_consolidate_namespaces calls nvme_create_ns (which invokes \u0027nvme create-ns\u0027) but never calls \u0027nvme attach-ns\u0027 to attach the newly created namespace to a controller. In the NVMe specification, a created namespace must be attached before it is active and usable. nvme_list_ns (nvme list-ns) returns...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: On any controller that does not auto-attach newly created namespaces (the standard behavior per NVMe spec), _consolidate_namespaces will create a namespace that cannot be found by nvme_list_ns, raising DeviceNotFound and aborting the write-zeroes or shred cleanup path. The cleanup operation fails...\n\n**Priority**: Before merge\n**Why This Matters**: On any controller that does not auto-attach newly created namespaces (the standard behavior per NVMe spec), _consolidate_namespaces will create a namespace that cannot be found by nvme_list_ns, raising DeviceNotFound and aborting the write-zeroes or shred cleanup path. The cleanup operation fails...\n\n**Recommendation**:\nAdd an nvme_attach_ns wrapper in nvme_cli.py (nvme attach-ns \u003cdev\u003e -n \u003cnsid\u003e -c \u003ccntid\u003e) and call it after nvme_create_ns in _consolidate_namespaces before rescanning. Use the NSID returned by create-ns or re-query to attach the correct namespace.","commit_id":"e5a7877ab9432515f4b22721a94b5af374abf44f"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"33baf50389841fb61216ccafd6cc3e6bfe3ac717","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        if ns_mgmt:"},{"line_number":424,"context_line":"            ns_dev, nsid \u003d self._consolidate_namespaces(nvme_dev)"},{"line_number":425,"context_line":"        else:"},{"line_number":426,"context_line":"            nsid \u003d nvme_cli.nvme_list_ns(nvme_dev)"},{"line_number":427,"context_line":"            ns_dev \u003d \u0027%sn%d\u0027 % (nvme_dev, nsid)"},{"line_number":428,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(ns_dev)"},{"line_number":429,"context_line":"        namespace_size \u003d id_ns.get(\u0027nsze\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"f5dbea0f_be76048a","line":426,"updated":"2026-08-11 09:54:26.000000000","message":"The new cleanup helper methods (_do_write_zeroes, _do_shred, _consolidate_namespaces) call nvme_cli.nvme_list_ns() and use the return value as an integer NSID in string formatting like \u0027%sn%d\u0027. However, nvme_list_ns returns the raw first element of the JSON list, which for nvme-cli 1.x format is...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: On any system running nvme-cli 1.x, device cleanup via write-zeroes or shred will fail because the namespace device path is constructed incorrectly. Sanitize-based cleanup is unaffected since it operates on the controller, not a namespace.\n\n**Priority**: Before merge\n**Why This Matters**: On any system running nvme-cli 1.x, device cleanup via write-zeroes or shred will fail because the namespace device path is constructed incorrectly. Sanitize-based cleanup is unaffected since it operates on the controller, not a namespace.\n\n**Recommendation**:\nEither fix nvme_list_ns to always return an integer NSID (e.g., extract nsid from the dict if the element is a dict), or handle both dict and int return types in the callers. The docstring already says \u0027:returns: integer NSID\u0027, so fixing nvme_list_ns to honor that contract is the cleaner approach.","commit_id":"cdc8f96862eb3088ec45dd164cf0d5edc8e7f617"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"33baf50389841fb61216ccafd6cc3e6bfe3ac717","unresolved":false,"context_lines":[{"line_number":461,"context_line":"        lba_size \u003d 1 \u003c\u003c lba_data_shift"},{"line_number":462,"context_line":"        lba_count \u003d total_capacity_bytes // lba_size if lba_size else 0"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        for nsid in range(1, num_namespaces + 1):"},{"line_number":465,"context_line":"            try:"},{"line_number":466,"context_line":"                nvme_cli.nvme_delete_ns(nvme_dev, nsid)"},{"line_number":467,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":8,"id":"bb18fb60_0165cdcf","line":464,"updated":"2026-08-11 09:54:26.000000000","message":"The namespace deletion loop in _consolidate_namespaces uses id_ctrl[\u0027nn\u0027] as the upper bound. Per the NVMe spec, nn is the maximum number of namespaces the controller supports (commonly 256 or more), not the count of active namespaces. The code issues nvme delete-ns for every NSID from 1 to nn, w...\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Device cleanup involving namespace consolidation (zero_wz or zero_shred with ns_mgmt\u003dTrue) will take significantly longer than necessary due to hundreds of failed nvme delete-ns process spawns, each going through privsep escalation.\n\n**Suggestion**:\nUse nvme list-ns to enumerate only active/allocated namespace IDs and delete those, instead of iterating 1..nn. Alternatively, read the active namespace list once and iterate over that.","commit_id":"cdc8f96862eb3088ec45dd164cf0d5edc8e7f617"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"cb2d7e0f4947989cb23d86b39249696ed4a0b7a7","unresolved":false,"context_lines":[{"line_number":410,"context_line":"                if status_bits \u003d\u003d 0x1:"},{"line_number":411,"context_line":"                    return"},{"line_number":412,"context_line":"                if status_bits \u003d\u003d 0x3:"},{"line_number":413,"context_line":"                    raise exception.DeviceCleanupFailed("},{"line_number":414,"context_line":"                        reason\u003d\u0027Sanitize failed: sstat\u003d%r\u0027 % sanitize_status"},{"line_number":415,"context_line":"                    )"},{"line_number":416,"context_line":"            time.sleep(5)"}],"source_content_type":"text/x-python","patch_set":9,"id":"51d88365_d88d60f7","line":413,"updated":"2026-08-11 15:58:00.000000000","message":"The cleanup code references exception.DeviceCleanupFailed in _poll_sanitize (two raise sites), but this exception class was never added to cyborg/common/exception.py. The most recent exception.py diff only added DeviceNotFound and InvalidConfiguration. This will cause AttributeError at runtime wh...\n\n**Severity**: CRITICAL | **Confidence**: 1.0\n\n**Risk**: When an NVMe sanitize operation fails (sstat reports failure bits 0x3) or times out, the code will raise AttributeError instead of DeviceCleanupFailed. This means cleanup errors are silently masked by a different exception type, the caller cannot catch the intended exception, and the error messag...\n\n**Priority**: Immediate\n**Why This Matters**: When an NVMe sanitize operation fails (sstat reports failure bits 0x3) or times out, the code will raise AttributeError instead of DeviceCleanupFailed. This means cleanup errors are silently masked by a different exception type, the caller cannot catch the intended exception, and the error messag...\n\n**Recommendation**:\nAdd a DeviceCleanupFailed exception class to cyborg/common/exception.py, following the existing pattern (e.g., subclass CyborgException with _msg_fmt \u003d _(\u0027Device cleanup failed: %(reason)s.\u0027)).","commit_id":"67434638d27723891802e584b1dc816bb94570b5"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"cb2d7e0f4947989cb23d86b39249696ed4a0b7a7","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        if ns_mgmt:"},{"line_number":424,"context_line":"            ns_dev, nsid \u003d self._consolidate_namespaces(nvme_dev)"},{"line_number":425,"context_line":"        else:"},{"line_number":426,"context_line":"            nsid \u003d nvme_cli.nvme_list_ns(nvme_dev)"},{"line_number":427,"context_line":"            ns_dev \u003d \u0027%sn%d\u0027 % (nvme_dev, nsid)"},{"line_number":428,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(ns_dev)"},{"line_number":429,"context_line":"        namespace_size \u003d id_ns.get(\u0027nsze\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":9,"id":"b2b16430_28710e25","line":426,"updated":"2026-08-11 15:58:00.000000000","message":"nvme_list_ns returns {\u0027id\u0027: 1} (a dict) for nvme-cli 1.x bare-array output, but returns an integer for 2.x format. The new cleanup code does ns_dev \u003d \u0027%sn%d\u0027 % (nvme_dev, nsid) which raises TypeError when nsid is a dict.\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: On systems with nvme-cli 1.x installed, all write-zeroes and shred cleanup operations will crash with TypeError. This affects the zero_wz and zero_shred cleanup paths entirely on 1.x deployments.\n\n**Priority**: Before merge\n**Why This Matters**: On systems with nvme-cli 1.x installed, all write-zeroes and shred cleanup operations will crash with TypeError. This affects the zero_wz and zero_shred cleanup paths entirely on 1.x deployments.\n\n**Recommendation**:\nFix nvme_list_ns to always return an integer NSID regardless of output format. For 1.x bare-array format, extract the \u0027nsid\u0027 or \u0027id\u0027 field: ns_list[0].get(\u0027nsid\u0027, ns_list[0].get(\u0027id\u0027)) if isinstance(ns_list[0], dict) else ns_list[0].","commit_id":"67434638d27723891802e584b1dc816bb94570b5"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"f58ae2b38f30486662c6c821f019c359cb39d6c5","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            sanitize_progress \u003d slog.get(\u0027sprog\u0027, 0xFFFF)"},{"line_number":425,"context_line":"            sanitize_status \u003d slog.get(\u0027sstat\u0027, 0)"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"            if sanitize_progress \u003d\u003d 0xFFFF:"},{"line_number":428,"context_line":"                status_bits \u003d self._parse_sanitize_status(sanitize_status)"},{"line_number":429,"context_line":"                if status_bits \u003d\u003d 0x1:"},{"line_number":430,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":10,"id":"77b240b1_e4062fda","line":427,"updated":"2026-08-12 09:35:49.000000000","message":"In _poll_sanitize, the success and failure checks are only evaluated when sprog \u003d\u003d 0xFFFF. If the sanitize status transitions to success (sstat bits 0x1) while sprog is still non-zero or zero (but not 0xFFFF), the method never recognizes the completed state and loops until timeout. The NVMe spec...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: On devices that report sprog\u003d0 (or any non-0xFFFF value) at completion, sanitize cleanup will always time out after the full cleanup_timeout period (default 900 s), wasting time and then raising DeviceCleanupFailed even though the sanitize actually succeeded.\n\n**Priority**: Before merge\n**Why This Matters**: On devices that report sprog\u003d0 (or any non-0xFFFF value) at completion, sanitize cleanup will always time out after the full cleanup_timeout period (default 900 s), wasting time and then raising DeviceCleanupFailed even though the sanitize actually succeeded.\n\n**Recommendation**:\nEvaluate success/failure status bits regardless of sprog value, or at minimum also check status bits when sprog is 0. Restructure so that sstat is checked on every poll iteration, not only when sprog \u003d\u003d 0xFFFF.","commit_id":"31220ba801bcd4bfbc750c931745d43bacfe71f5"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"ee45d4c69ec9e35dc559c3d3fb62e0b31dd336df","unresolved":false,"context_lines":[{"line_number":476,"context_line":"        cntlid \u003d id_ctrl.get(\u0027cntlid\u0027, 0)"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        # Read LBA format from namespace 1 before deleting anything."},{"line_number":479,"context_line":"        first_ns_dev \u003d \u0027%sn1\u0027 % nvme_dev"},{"line_number":480,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(first_ns_dev)"},{"line_number":481,"context_line":"        active_lba_format \u003d id_ns.get(\u0027flbas\u0027, 0)"},{"line_number":482,"context_line":"        lba_formats \u003d id_ns.get(\u0027lbaf\u0027, [{\u0027ds\u0027: 9}])"}],"source_content_type":"text/x-python","patch_set":11,"id":"1431fdf8_d7b8b39d","line":479,"updated":"2026-08-13 05:21:57.000000000","message":"The method unconditionally reads id-ns for \u0027/dev/nvmeXn1\u0027 to extract the LBA format, but nsid 1 may not be an active namespace on the controller. If it does not exist, nvme_id_ns raises a ProcessExecutionError that is not caught, resulting in an unhandled exception rather than a meaningful Device...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: On NVMe controllers where nsid 1 is not an active namespace, namespace consolidation will fail with an opaque ProcessExecutionError instead of a clear DeviceCleanupFailed error, making debugging difficult.\n\n**Priority**: Before merge\n**Why This Matters**: On NVMe controllers where nsid 1 is not an active namespace, namespace consolidation will fail with an opaque ProcessExecutionError instead of a clear DeviceCleanupFailed error, making debugging difficult.\n\n**Recommendation**:\nWrap the nvme_id_ns call in a try/except and either use a fallback LBA format or list active namespaces first to find one whose id-ns can be read. Alternatively, catch the exception and raise DeviceCleanupFailed with a descriptive message.","commit_id":"c0628056e9c79512c970ed75974c9208c621c31a"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"ee45d4c69ec9e35dc559c3d3fb62e0b31dd336df","unresolved":false,"context_lines":[{"line_number":489,"context_line":"        lba_size \u003d 1 \u003c\u003c lba_data_shift"},{"line_number":490,"context_line":"        lba_count \u003d total_capacity_bytes // lba_size if lba_size else 0"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        for nsid in range(1, num_namespaces + 1):"},{"line_number":493,"context_line":"            try:"},{"line_number":494,"context_line":"                nvme_cli.nvme_delete_ns(nvme_dev, nsid)"},{"line_number":495,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ab9785c3_f9c24347","line":492,"updated":"2026-08-13 05:21:57.000000000","message":"The method loops nsid from 1 to num_namespaces (nn from id-ctrl) and calls nvme_delete_ns for each. The NVMe nn field is the maximum number of namespace IDs the controller supports, not the count of currently active namespaces. Deleting non-existent namespace IDs may produce errors on some contro...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: On controllers with nn \u003e number of active namespaces (common), deleting non-existent NSIDs may error and abort cleanup prematurely. The behavior depends on the controller firmware and nvme-cli version.\n\n**Priority**: Before merge\n**Why This Matters**: On controllers with nn \u003e number of active namespaces (common), deleting non-existent NSIDs may error and abort cleanup prematurely. The behavior depends on the controller firmware and nvme-cli version.\n\n**Recommendation**:\nUse nvme_list_ns to get the list of active namespace IDs and delete only those, rather than iterating all possible NSIDs from 1 to nn. Alternatively, only delete namespaces that exist by querying active namespaces first.","commit_id":"c0628056e9c79512c970ed75974c9208c621c31a"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"f08492db70ccad92b81a752214af6618b497b824","unresolved":false,"context_lines":[{"line_number":489,"context_line":"        lba_size \u003d 1 \u003c\u003c lba_data_shift"},{"line_number":490,"context_line":"        lba_count \u003d total_capacity_bytes // lba_size if lba_size else 0"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        for nsid in range(1, num_namespaces + 1):"},{"line_number":493,"context_line":"            try:"},{"line_number":494,"context_line":"                nvme_cli.nvme_delete_ns(nvme_dev, nsid)"},{"line_number":495,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"eed26fc9_66212424","line":492,"updated":"2026-08-13 14:21:41.000000000","message":"When zero_wz or zero_shred runs with ns_mgmt\u003dtrue, _consolidate_namespaces() calls nvme delete-ns for every NSID 1..nn before creating the replacement namespace, and reads the LBA format from a hard-coded \u0027%sn1\u0027 device. This destroys data on namespaces the tenant never touched and fails outright...\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: A cleanup of one released accelerator wipes every namespace on the drive, including namespaces belonging to other consumers; on drives with no nsid-1 namespace or with the first active namespace at a higher NSID, id-ns on /dev/nvme0n1 raises and cleanup aborts after potentially already deleting n...\n\n**Priority**: Before merge\n**Why This Matters**: A cleanup of one released accelerator wipes every namespace on the drive, including namespaces belonging to other consumers; on drives with no nsid-1 namespace or with the first active namespace at a higher NSID, id-ns on /dev/nvme0n1 raises and cleanup aborts after potentially already deleting n...\n\n**Recommendation**:\nEnumerate active namespaces via nvme_list_ns / list-ns -a instead of range(1, nn+1), derive the LBA format from an active namespace (or id-ns of the namespace being zeroed) rather than the hard-coded \u0027%sn1\u0027, and make deletion failure of a non-existent namespace non-fatal. Consider whether consolidation is needed at all when only one namespace exists.","commit_id":"5a43f887d0f0dff019290d6a6852101b0cd89bb8"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"cae37a88b4d39e4ee1f5c8d9becd8be01688ec12","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    def _do_sanitize(self, nvme_dev, action):"},{"line_number":380,"context_line":"        slog \u003d nvme_cli.nvme_sanitize_log(nvme_dev)"},{"line_number":381,"context_line":"        if self._should_start_sanitize(slog):"},{"line_number":382,"context_line":"            action_code \u003d 4 if action \u003d\u003d CLEANUP_SANITIZE_CES else 2"},{"line_number":383,"context_line":"            nvme_cli.nvme_sanitize(nvme_dev, action_code)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"        self._poll_sanitize(nvme_dev)"}],"source_content_type":"text/x-python","patch_set":13,"id":"b6f63f34_8384bf51","line":382,"updated":"2026-08-14 16:03:37.000000000","message":"_do_sanitize maps sanitize_ces to action code 4 and sanitize_bes to code 2, but per NVMe 2.x the SANACT field value 100b (4) is Overwrite and 011b (3) is Crypto Erase; Block Erase is 010b (2). The 4 for CES silently executes the wrong erase method.\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: Drives whose config only enables crypto erase (SANICAP.CES\u003d1, BES\u003d0) will reject the command or, on drives that also support overwrite, run overwrite with the default pattern instead of the intended key-based crypto erase. Cleanup raises DeviceCleanupFailed or performs the wrong sanitization oper...\n\n**Priority**: Before merge\n**Why This Matters**: Drives whose config only enables crypto erase (SANICAP.CES\u003d1, BES\u003d0) will reject the command or, on drives that also support overwrite, run overwrite with the default pattern instead of the intended key-based crypto erase. Cleanup raises DeviceCleanupFailed or performs the wrong sanitization oper...\n\n**Recommendation**:\nUse action code 3 for CLEANUP_SANITIZE_CES (and keep 2 for BES). Update the commit message, unit-test assertions (mock_san.assert_called_once_with(\u0027/dev/nvme0\u0027, 4)) and any capability-resolution comments that reference crypto erase.","commit_id":"950ef9b636d768545b84c2e5a674a3ede6011f6f"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"cae37a88b4d39e4ee1f5c8d9becd8be01688ec12","unresolved":false,"context_lines":[{"line_number":476,"context_line":"        cntlid \u003d id_ctrl.get(\u0027cntlid\u0027, 0)"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"        # Read LBA format from namespace 1 before deleting anything."},{"line_number":479,"context_line":"        first_ns_dev \u003d \u0027%sn1\u0027 % nvme_dev"},{"line_number":480,"context_line":"        id_ns \u003d nvme_cli.nvme_id_ns(first_ns_dev)"},{"line_number":481,"context_line":"        active_lba_format \u003d id_ns.get(\u0027flbas\u0027, 0)"},{"line_number":482,"context_line":"        lba_formats \u003d id_ns.get(\u0027lbaf\u0027, [{\u0027ds\u0027: 9}])"}],"source_content_type":"text/x-python","patch_set":13,"id":"a53ee252_1b4c5c1b","line":479,"updated":"2026-08-14 16:03:37.000000000","message":"Consolidation reads id-ns from \u0027%sn1\u0027 before deleting namespaces. The patch itself fixed exactly this assumption in the write-zeroes path (nvme_write_zeroes now uses the NSID from nvme_list_ns instead of hardcoded 1, per the commit message), but the flbas/lbaf discovery still hardcodes namespace 1.\n\n**Severity**: HIGH | **Confidence**: 0.8\n\n**Risk**: On drives whose lowest active NSID is not 1 (previously deleted-and-recreated topologies, or drives where NSID 1 is inactive), id-ns fails and the entire ns_mgmt cleanup path aborts before any consolidation runs.\n\n**Priority**: Before merge\n**Why This Matters**: On drives whose lowest active NSID is not 1 (previously deleted-and-recreated topologies, or drives where NSID 1 is inactive), id-ns fails and the entire ns_mgmt cleanup path aborts before any consolidation runs.\n\n**Recommendation**:\nResolve the actual first active NSID via nvme_list_ns(nvme_dev) (already available and used at the end of this same function) and read id-ns from that namespace device, consistent with the fix already applied in _do_write_zeroes.","commit_id":"950ef9b636d768545b84c2e5a674a3ede6011f6f"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"cae37a88b4d39e4ee1f5c8d9becd8be01688ec12","unresolved":false,"context_lines":[{"line_number":489,"context_line":"        lba_size \u003d 1 \u003c\u003c lba_data_shift"},{"line_number":490,"context_line":"        lba_count \u003d total_capacity_bytes // lba_size if lba_size else 0"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        for nsid in range(1, num_namespaces + 1):"},{"line_number":493,"context_line":"            try:"},{"line_number":494,"context_line":"                nvme_cli.nvme_delete_ns(nvme_dev, nsid)"},{"line_number":495,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":13,"id":"a29d2da6_dc31415c","line":492,"updated":"2026-08-14 16:03:37.000000000","message":"_consolidate_namespaces deletes NSIDs 1..nn in a fixed range loop. The controller\u0027s nn field is the maximum number of namespaces supported, and valid NSIDs can be sparse and non-contiguous; inactive NSIDs inside the range are legal and cause nvme delete-ns to fail.\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: On drives where active namespaces are sparse or where the lowest NSID exceeds 1, the loop aborts the whole cleanup with DeviceCleanupFailed (leaving a partially deleted, unusable drive with prior namespaces already deleted) or misses namespaces that were never deleted. Either outcome strands the...\n\n**Priority**: Before merge\n**Why This Matters**: On drives where active namespaces are sparse or where the lowest NSID exceeds 1, the loop aborts the whole cleanup with DeviceCleanupFailed (leaving a partially deleted, unusable drive with prior namespaces already deleted) or misses namespaces that were never deleted. Either outcome strands the...\n\n**Recommendation**:\nEnumerate actual namespaces via nvme list-ns (optionally --all) and delete exactly those NSIDs, treating \u0027namespace does not exist\u0027/inactive-NSID errors from delete-ns as success instead of a hard DeviceCleanupFailed failure.","commit_id":"950ef9b636d768545b84c2e5a674a3ede6011f6f"}],"cyborg/accelerator/drivers/nvme/nvme_cli.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"f08492db70ccad92b81a752214af6618b497b824","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        str(flbas),"},{"line_number":130,"context_line":"    )"},{"line_number":131,"context_line":"    # Output: \"create-ns: Success, created nsid:3\" (space after colon is optional)"},{"line_number":132,"context_line":"    if \u0027nsid:\u0027 in out:"},{"line_number":133,"context_line":"        return int(out.split(\u0027nsid:\u0027, 1)[1].split()[0].strip(\u0027,\u0027))"},{"line_number":134,"context_line":"    raise exception.DeviceNotFound(device\u003dnvme_dev)"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7952fc09_1e147d0e","line":132,"updated":"2026-08-13 14:21:41.000000000","message":"When the nvme create-ns output does not contain \u0027nsid:\u0027, nvme_create_ns raises DeviceNotFound(device\u003dnvme_dev). The namespace was actually created in that scenario; the failure is an output-parsing problem, not a missing device.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Operators see \u0027Device /dev/nvme0 not found\u0027 for a controller that is present, misdirecting debugging; the driver also loses the chance to report the raw command output that caused the parse failure.\n\n**Suggestion**:\nRaise InvalidConfiguration (as nvme_list_ns does for unexpected output shapes, nvme_cli.py:182) or a DeviceCleanupFailed with the raw output in the reason, so the error reflects an output-format problem on an existing device.","commit_id":"5a43f887d0f0dff019290d6a6852101b0cd89bb8"}],"cyborg/agent/manager.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"3d8b89bee46d9312afc04a2781c90c8453c3a735","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _set_nvme_placement_reserved(self, context, device, reserved):"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            deployables \u003d objects.Deployable.get_list_by_device_id("},{"line_number":141,"context_line":"                context, device.id"},{"line_number":142,"context_line":"            )"},{"line_number":143,"context_line":"            for dep in deployables:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f9ff4c2_e98fea95","line":140,"updated":"2026-08-07 16:46:41.000000000","message":"The new code in cyborg/agent/manager.py references objects.Deployable, objects.Attribute, objects.Device, objects.AttachHandle, and cyborg_context.get_admin_context(), but neither \u0027from cyborg import objects\u0027 nor \u0027from cyborg import context as cyborg_context\u0027 is imported in the module. This cause...\n\n**Severity**: CRITICAL | **Confidence**: 1.0\n\n**Risk**: At runtime, _set_nvme_placement_reserved always fails silently (NameError caught by its except). Placement reserved state is never updated when cleanup fails, so a device with failed sanitization holding tenant data could be re-allocated. Unit tests mocking \u0027cyborg.agent.manager.objects.*\u0027 and \u0027c...\n\n**Priority**: Immediate\n**Why This Matters**: At runtime, _set_nvme_placement_reserved always fails silently (NameError caught by its except). Placement reserved state is never updated when cleanup fails, so a device with failed sanitization holding tenant data could be re-allocated. Unit tests mocking \u0027cyborg.agent.manager.objects.*\u0027 and \u0027c...\n\n**Recommendation**:\nAdd \u0027from cyborg import objects\u0027 and \u0027from cyborg import context as cyborg_context\u0027 to the import block in cyborg/agent/manager.py, following the pattern used in cyborg/cmd/status.py and other modules.","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _set_nvme_placement_reserved(self, context, device, reserved):"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            deployables \u003d objects.Deployable.get_list_by_device_id("},{"line_number":141,"context_line":"                context, device.id"},{"line_number":142,"context_line":"            )"},{"line_number":143,"context_line":"            for dep in deployables:"}],"source_content_type":"text/x-python","patch_set":6,"id":"c413ff05_dc838264","line":140,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `objects`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            )"},{"line_number":143,"context_line":"            for dep in deployables:"},{"line_number":144,"context_line":"                filters \u003d {\u0027deployable_id\u0027: dep.id, \u0027key\u0027: \u0027rc\u0027}"},{"line_number":145,"context_line":"                attrs \u003d objects.Attribute.get_by_filter(context, filters)"},{"line_number":146,"context_line":"                if not attrs:"},{"line_number":147,"context_line":"                    continue"},{"line_number":148,"context_line":"                rc \u003d attrs[0].value"}],"source_content_type":"text/x-python","patch_set":6,"id":"d92e30f3_344c18ee","line":145,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `objects`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"3d8b89bee46d9312afc04a2781c90c8453c3a735","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                device.uuid,"},{"line_number":157,"context_line":"            )"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _reconcile_device_states(self):"},{"line_number":160,"context_line":"        try:"},{"line_number":161,"context_line":"            self._do_reconcile_device_states()"},{"line_number":162,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":6,"id":"4201e255_95447c0f","line":159,"updated":"2026-08-07 16:46:41.000000000","message":"The _reconcile_device_states() and _do_reconcile_device_states() methods added to AgentManager are never invoked from init_host() or any periodic task. The device state reconciliation logic will never run, making it dead code.\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: Devices stuck in \u0027cleaning\u0027 or \u0027pending_cleaning\u0027 state from a crashed agent will not be transitioned to \u0027error\u0027 on restart. Allocated devices with no active ARQs will not trigger cleanup. The reconciliation feature is effectively non-functional.\n\n**Suggestion**:\nAdd a call to self._reconcile_device_states() in init_host() after self._rt.check_duplicate_devices(), or wire it into a periodic task, so the reconciliation logic actually executes.","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":166,"context_line":"            )"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _do_reconcile_device_states(self):"},{"line_number":169,"context_line":"        context \u003d cyborg_context.get_admin_context()"},{"line_number":170,"context_line":"        devices \u003d objects.Device.get_list_by_hostname("},{"line_number":171,"context_line":"            context,"},{"line_number":172,"context_line":"            self.resource_provider_name,"}],"source_content_type":"text/x-python","patch_set":6,"id":"642fe125_dad2a09b","line":169,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `cyborg_context`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def _do_reconcile_device_states(self):"},{"line_number":169,"context_line":"        context \u003d cyborg_context.get_admin_context()"},{"line_number":170,"context_line":"        devices \u003d objects.Device.get_list_by_hostname("},{"line_number":171,"context_line":"            context,"},{"line_number":172,"context_line":"            self.resource_provider_name,"},{"line_number":173,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":6,"id":"aaa1006b_9b38f206","line":170,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `objects`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                        device.save(context)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def _has_active_arqs(self, context, device):"},{"line_number":200,"context_line":"        deployables \u003d objects.Deployable.get_list_by_device_id("},{"line_number":201,"context_line":"            context,"},{"line_number":202,"context_line":"            device.id,"},{"line_number":203,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":6,"id":"5b489ee9_fd03f584","line":200,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `objects`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"425913c25bd68adef6af3c972f2c1e2f374509bc","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            device.id,"},{"line_number":203,"context_line":"        )"},{"line_number":204,"context_line":"        for dep in deployables:"},{"line_number":205,"context_line":"            ahs \u003d objects.AttachHandle.get_ah_list_by_deployable_id("},{"line_number":206,"context_line":"                context,"},{"line_number":207,"context_line":"                dep.id,"},{"line_number":208,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":6,"id":"b41cedc6_d8f19472","line":205,"updated":"2026-08-07 17:30:10.000000000","message":"pep8: F821 Undefined name `objects`","commit_id":"ecde3b63875419656f66fe6f85e3b5ce09da594f"}],"cyborg/tests/unit/accelerator/drivers/nvme/test_driver.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"7c72e40a0dd488eca5935d2881741dacdcd6d28a","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    return device"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"class TestNVMeDriverCleanup(base.TestCase):"},{"line_number":394,"context_line":"    @mock.patch.object(nvme_cli, \u0027nvme_sanitize\u0027)"},{"line_number":395,"context_line":"    @mock.patch.object(nvme_cli, \u0027nvme_sanitize_log\u0027)"},{"line_number":396,"context_line":"    def test_sanitize_ces(self, mock_log, mock_san):"}],"source_content_type":"text/x-python","patch_set":4,"id":"69238278_c7db3ba0","line":393,"updated":"2026-08-06 17:07:49.000000000","message":"The _poll_sanitize method has a timeout code path that raises DeviceCleanupFailed when the polling deadline is exceeded. None of the new tests exercise this path. All sanitize tests resolve within two sanitize-log mock calls (one for _do_sanitize, one for _poll_sanitize), so the timeout branch at...\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: The timeout error handling code (lines 336-339) is untested. A regression in the timeout calculation (e.g., wrong deadline arithmetic) or the exception construction could go undetected. The timeout path is important because it prevents cleanup from hanging indefinitely on a stuck device.\n\n**Recommendation**:\nAdd a test that mocks nvme_sanitize_log to always return an in-progress status (e.g., sprog\u003d0x1000, sstat\u003d0x2) so the while loop exhausts the deadline, and assert that DeviceCleanupFailed is raised. Mock time.monotonic and time.sleep to avoid real delays.","commit_id":"06c54c9ca00f6ea76abb6f7c0529d021511af6ad"}]}
