fix record io bug

This commit is contained in:
Dmitry Vasilev
2023-07-15 17:59:58 +03:00
parent e8f41d9659
commit 4118bc63d2
3 changed files with 63 additions and 22 deletions

View File

@@ -154,8 +154,10 @@ const make_patched_method = (original, name, use_context) => {
)
){
cxt.io_trace_is_replay_aborted = true
// Try to finish fast
// TODO invoke callback to notify that code must be restarted?
cxt.io_trace_abort_replay()
// throw error to prevent further code execution. It
// is not necesseary, becuase execution would not have
// any effects anyway
const error = new Error('io replay aborted')
error.__ignore = true
throw error
@@ -188,7 +190,7 @@ const make_patched_method = (original, name, use_context) => {
const next_event = cxt.io_trace[cxt.io_trace_index]
if(next_event.type == 'call') {
cxt.io_trace_is_replay_aborted = true
// TODO reject? Test for never resolved
cxt.io_trace_abort_replay()
} else {
while(
cxt.io_trace_index < cxt.io_trace.length