This commit is contained in:
Daniel 2023-12-24 15:23:30 +08:00
parent 8693670d60
commit b3d51ed94f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"path/filepath"
"runtime/debug"
"strings"
"sync"
"sync/atomic"
@ -168,6 +169,19 @@ func performTx(tx *Transaction) (ret *TxErr) {
return
}
defer func() {
if e := recover(); nil != e {
stack := debug.Stack()
msg := fmt.Sprintf("PANIC RECOVERED: %v\n\t%s\n", e, stack)
logging.LogErrorf(msg)
if 0 == tx.state.Load() {
tx.rollback()
return
}
}
}()
for _, op := range tx.DoOperations {
switch op.Action {
case "create":