)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ef40bd479a135a4cc0bd82de330fb071d7e6d70b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"e59ac5fb_e855e4e0","updated":"2025-11-03 21:37:25.000000000","message":"Clif is raising a solid point. I think there are two conditions and we\u0027ve historically only addressed one, I think the overall concern can be navigated with a quick refresh to double check the state.","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"},{"author":{"_account_id":14228,"name":"Clif Houck","email":"me@clifhouck.com","username":"clif_h"},"change_message_id":"437c81e58c03db42ef07f07bed0d898166118396","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"eb05cacd_5dac3b6a","updated":"2025-11-03 15:20:13.000000000","message":"Is there a risk of needing a power cycle but one never occuring? Ie we want to go from on -\u003e off -\u003e on, but being in the target state already causes us to skip the crucial step of making sure the node went to off first?\n\nI\u0027m not saying this *is* a risk with the current change, but the thought occured to me, and wanted to check.","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ef40bd479a135a4cc0bd82de330fb071d7e6d70b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"da024b01_c775e8d9","in_reply_to":"eb05cacd_5dac3b6a","updated":"2025-11-03 21:37:25.000000000","message":"I think there is a race condition risk on the front end and the backend. Basically what we\u0027re sort of lacking and the code handles the front-end state where we somehow were still asked about the state and it heads off an error, but the reality is if the bmc independently reached the desired target state, we need to refresh our state data to make that final determination because the system object, afaik and a cursory look at the redfish code suggests, doesn\u0027t refresh when an error occurs.","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"}],"ironic/drivers/modules/redfish/power.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"326d2240b3270a24bd0d86cff07e59307fe98d84","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            # Check if this is an HTTP 409 Conflict error indicating the node"},{"line_number":156,"context_line":"            # is already in the desired state"},{"line_number":157,"context_line":"            error_msg_str \u003d str(e)"},{"line_number":158,"context_line":"            if \u0027returned code 409\u0027 in error_msg_str:"},{"line_number":159,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":160,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"213f2f55_c4810813","line":158,"updated":"2025-10-29 15:59:52.000000000","message":"Please catch HTTPError and check its status_code instead","commit_id":"ea345cdec5c5cfe308f383f3bc84444a2c09ea0d"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"2c66e329bd6e2f43c8eef8a4c7109e856c1abb1f","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            # Check if this is an HTTP 409 Conflict error indicating the node"},{"line_number":156,"context_line":"            # is already in the desired state"},{"line_number":157,"context_line":"            error_msg_str \u003d str(e)"},{"line_number":158,"context_line":"            if \u0027returned code 409\u0027 in error_msg_str:"},{"line_number":159,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":160,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5abd4457_b789099b","line":158,"in_reply_to":"05bb592d_e734f344","updated":"2025-11-04 09:51:41.000000000","message":"Done","commit_id":"ea345cdec5c5cfe308f383f3bc84444a2c09ea0d"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"4afbb34d8305edd1009b1f335112de145f483944","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            # Check if this is an HTTP 409 Conflict error indicating the node"},{"line_number":156,"context_line":"            # is already in the desired state"},{"line_number":157,"context_line":"            error_msg_str \u003d str(e)"},{"line_number":158,"context_line":"            if \u0027returned code 409\u0027 in error_msg_str:"},{"line_number":159,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":160,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"05bb592d_e734f344","line":158,"in_reply_to":"213f2f55_c4810813","updated":"2025-10-29 16:08:55.000000000","message":"I can probably just include both badrequest and conflict in one try except including 400 and 409, I think that\u0027s even cleaner","commit_id":"ea345cdec5c5cfe308f383f3bc84444a2c09ea0d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"326d2240b3270a24bd0d86cff07e59307fe98d84","unresolved":true,"context_lines":[{"line_number":159,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":160,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"                # Check for hints in the error message"},{"line_number":163,"context_line":"                if current_state is None:"},{"line_number":164,"context_line":"                    error_msg_lower \u003d error_msg_str.lower()"},{"line_number":165,"context_line":"                    if (target_state \u003d\u003d states.POWER_OFF"}],"source_content_type":"text/x-python","patch_set":1,"id":"ddd34a84_80f18480","line":162,"updated":"2025-10-29 15:59:52.000000000","message":"Could you extract the common bits into a helper?","commit_id":"ea345cdec5c5cfe308f383f3bc84444a2c09ea0d"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"2c66e329bd6e2f43c8eef8a4c7109e856c1abb1f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":160,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"                # Check for hints in the error message"},{"line_number":163,"context_line":"                if current_state is None:"},{"line_number":164,"context_line":"                    error_msg_lower \u003d error_msg_str.lower()"},{"line_number":165,"context_line":"                    if (target_state \u003d\u003d states.POWER_OFF"}],"source_content_type":"text/x-python","patch_set":1,"id":"2af21141_64898ff1","line":162,"in_reply_to":"ddd34a84_80f18480","updated":"2025-11-04 09:51:41.000000000","message":"Done","commit_id":"ea345cdec5c5cfe308f383f3bc84444a2c09ea0d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ef40bd479a135a4cc0bd82de330fb071d7e6d70b","unresolved":true,"context_lines":[{"line_number":128,"context_line":"            # the BMC indicates the node is already in the desired state"},{"line_number":129,"context_line":"            if e.status_code in (400, 409):"},{"line_number":130,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":131,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"                # If current state is undetermined, check for hints in the"},{"line_number":134,"context_line":"                # error message."}],"source_content_type":"text/x-python","patch_set":3,"id":"0e42fcaf_d70c66f7","line":131,"updated":"2025-11-03 21:37:25.000000000","message":"It occurs to me that there is a bug here, or at least in the prior state.\n\nBasically system.power_state is a constant on class init or mapping refresh from the driver, and that would kind of address other reviewer concerns.\n\nso basically add system.refresh(force\u003dTrue) between 130 and 131.","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"7e455198c0aa49d22f608458a331a9a7a5e6afda","unresolved":true,"context_lines":[{"line_number":128,"context_line":"            # the BMC indicates the node is already in the desired state"},{"line_number":129,"context_line":"            if e.status_code in (400, 409):"},{"line_number":130,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":131,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"                # If current state is undetermined, check for hints in the"},{"line_number":134,"context_line":"                # error message."}],"source_content_type":"text/x-python","patch_set":3,"id":"e53e75ec_07141f67","line":131,"in_reply_to":"0e42fcaf_d70c66f7","updated":"2025-11-04 09:38:48.000000000","message":"mmm I see, the system status is cached from L117 call, so we don\u0027t get a fresh value during the HTTP request\nOk, I\u0027ll add a call there to fix that behavior","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"2c66e329bd6e2f43c8eef8a4c7109e856c1abb1f","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            # the BMC indicates the node is already in the desired state"},{"line_number":129,"context_line":"            if e.status_code in (400, 409):"},{"line_number":130,"context_line":"                target_state \u003d TARGET_STATE_MAP.get(power_state, power_state)"},{"line_number":131,"context_line":"                current_state \u003d GET_POWER_STATE_MAP.get(system.power_state)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"                # If current state is undetermined, check for hints in the"},{"line_number":134,"context_line":"                # error message."}],"source_content_type":"text/x-python","patch_set":3,"id":"a1a0c991_757fc7c4","line":131,"in_reply_to":"e53e75ec_07141f67","updated":"2025-11-04 09:51:41.000000000","message":"Done","commit_id":"75b1cd86c0808534e653a0ba7caab7f6da5fd52b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"711de98957c4ab2b8ff1d016f5c82be0c5efff2b","unresolved":true,"context_lines":[{"line_number":133,"context_line":"                # instead of using potentially stale cached data"},{"line_number":134,"context_line":"                try:"},{"line_number":135,"context_line":"                    system.refresh()"},{"line_number":136,"context_line":"                except Exception as refresh_error:"},{"line_number":137,"context_line":"                    LOG.warning(\u0027Failed to refresh system state for node \u0027"},{"line_number":138,"context_line":"                                \u0027%(node)s: %(error)s\u0027,"},{"line_number":139,"context_line":"                                {\u0027node\u0027: task.node.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"82e2cf60_d4a8f650","line":136,"updated":"2025-11-04 20:41:47.000000000","message":"As an aside, the worst that can really happen here is if the session fails internally and the redfish client gets invalidated, but on next access it will re-activate.","commit_id":"3e778ef9542b447a65d076dacf8983dca6ade0e3"}]}
