mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-03-05 08:17:39 +08:00
fix: resolve rare SIGFPE, fix orphan expired joins blocking workers from reallocating
This commit is contained in:
parent
db4efe35cd
commit
87f2872cc8
@ -766,6 +766,21 @@ func (e *GlobalConsensusEngine) reconcileWorkerAllocations(
|
||||
continue
|
||||
}
|
||||
|
||||
// Expired joins (implicitly rejected) and expired leaves
|
||||
// (implicitly confirmed) should also be cleared immediately —
|
||||
// the allocation will never be confirmed/completed and the
|
||||
// worker is stuck waiting for a state change that cannot come.
|
||||
if alloc.Status == typesconsensus.ProverStatusJoining &&
|
||||
frameNumber > alloc.JoinFrameNumber+pendingFilterGraceFrames {
|
||||
rejectedFilters[string(alloc.ConfirmationFilter)] = struct{}{}
|
||||
continue
|
||||
}
|
||||
if alloc.Status == typesconsensus.ProverStatusLeaving &&
|
||||
frameNumber > alloc.LeaveFrameNumber+pendingFilterGraceFrames {
|
||||
rejectedFilters[string(alloc.ConfirmationFilter)] = struct{}{}
|
||||
continue
|
||||
}
|
||||
|
||||
key := string(alloc.ConfirmationFilter)
|
||||
worker, ok := filtersToWorkers[key]
|
||||
if !ok {
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"math/big"
|
||||
"net"
|
||||
"net/http"
|
||||
npprof "net/http/pprof"
|
||||
"os"
|
||||
@ -46,6 +47,12 @@ import (
|
||||
qruntime "source.quilibrium.com/quilibrium/monorepo/utils/runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Use the pure-Go DNS resolver to avoid SIGFPE crashes in cgo-based
|
||||
// system resolvers (observed on some glibc/musl configurations).
|
||||
net.DefaultResolver = &net.Resolver{PreferGo: true}
|
||||
}
|
||||
|
||||
var (
|
||||
configDirectory = flag.String(
|
||||
"config",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user