fix: retain native save completion through cancellation and restart
This commit is contained in:
1 parent
18349413c5
commit
443668aa4b
11 files changed
+220
-45
No files matched your search
@@ -1472,10 +1472,24 @@ def _run_verify(request, *, timing, progress=None, flag_reader=None, process_run
|
||||
from .operation_lifecycle import classify_save_state
|
||||
save_lines = ((root/'save.log').read_text('utf-8', errors='replace').splitlines()
|
||||
if (root/'save.log').is_file() else [])
|
||||
_write_optional_evidence(root/'write-outcome.json', classify_save_state(save_lines,
|
||||
facts = classify_save_state(save_lines,
|
||||
helper_exited=(False if automation_release.get('remaining_pids') else
|
||||
True if worker_exited and automation_release.get('safe_to_continue') else None),
|
||||
native_released=release_result.get('safe_to_continue') is True))
|
||||
native_released=release_result.get('safe_to_continue') is True)
|
||||
if 'SAVE_START' in save_lines and getattr(process, 'session_record_path', None):
|
||||
from .session_record import read_session_record
|
||||
try:
|
||||
state = read_session_record(root/'worker-state.json', evidence_root=root)
|
||||
except (OSError, ValueError):
|
||||
state = {}
|
||||
receipt = state.get('write_outcome')
|
||||
confirmed = (state.get('operation_id') == job['operation_id']
|
||||
and isinstance(receipt, dict) and receipt.get('save_close_confirmed') is True)
|
||||
facts['save_close_confirmed'] = confirmed
|
||||
if facts['helper_state'] == 'EXITED' and not confirmed:
|
||||
facts['interrupted'] = True
|
||||
facts['detail'] = '缺少保存助手正常退出的完整记录'
|
||||
_write_optional_evidence(root/'write-outcome.json', facts)
|
||||
(root/'session-release.json').write_text(json.dumps({
|
||||
**(release_result or {}), 'block': request.block_name,
|
||||
'library': str(request.lmc_file), 'worker_exited': worker_exited,
|
||||
|
||||
Reference in new issue
Block a user