system: partial I inherit dispatcher
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 2m38s
Test / Hakurei (push) Successful in 4m23s
Test / Sandbox (race detector) (push) Successful in 5m34s
Test / Hpkg (push) Successful in 6m42s
Test / Hakurei (race detector) (push) Successful in 7m19s
Test / Flake checks (push) Successful in 3m1s

This enables I struct methods to be checked.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-09-11 02:02:31 +09:00
parent c8a0effe90
commit 6265aea73a
2 changed files with 150 additions and 3 deletions

View File

@@ -4,7 +4,6 @@ package system
import (
"context"
"errors"
"log"
"strings"
)
@@ -116,14 +115,15 @@ func (sys *I) Commit() error {
sys.committed = true
sp := New(sys.ctx, sys.uid)
sp.syscallDispatcher = sys.syscallDispatcher
sp.ops = make([]Op, 0, len(sys.ops)) // prevent copies during commits
defer func() {
// sp is set to nil when all ops are applied
if sp != nil {
// rollback partial commit
msg.Verbosef("commit faulted after %d ops, rolling back partial commit", len(sp.ops))
sys.verbosef("commit faulted after %d ops, rolling back partial commit", len(sp.ops))
if err := sp.Revert(nil); err != nil {
printJoinedError(log.Println, "cannot revert partial commit:", err)
printJoinedError(sys.println, "cannot revert partial commit:", err)
}
}
}()