more logs
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m18s

This commit is contained in:
matst80
2024-11-12 21:24:39 +01:00
parent 39244350e8
commit 80d2c5b749

View File

@@ -105,7 +105,7 @@ func (p *SyncedPool) GrainOwnerChangeHandler(data []byte) (PoolMessage, []byte,
} }
id := ToCartId(idAndHostParts[0]) id := ToCartId(idAndHostParts[0])
host := idAndHostParts[1] host := idAndHostParts[1]
log.Println("Handling grain owner change to %s for id %s\n", host, id)
for _, r := range p.remotes { for _, r := range p.remotes {
if r.Host == host { if r.Host == host {
// log.Printf("Remote grain %s changed to %s\n", id, host) // log.Printf("Remote grain %s changed to %s\n", id, host)
@@ -115,7 +115,6 @@ func (p *SyncedPool) GrainOwnerChangeHandler(data []byte) (PoolMessage, []byte,
return AckChange, []byte("ok"), nil return AckChange, []byte("ok"), nil
} }
} }
go p.AddRemote(host) go p.AddRemote(host)
return AckChange, []byte("ok"), nil return AckChange, []byte("ok"), nil
} }
@@ -128,7 +127,7 @@ func (p *SyncedPool) RemoveRemoteGrain(id CartId) {
func (p *SyncedPool) SpawnRemoteGrain(id CartId, host string) { func (p *SyncedPool) SpawnRemoteGrain(id CartId, host string) {
if p.local.grains[id] != nil { if p.local.grains[id] != nil {
log.Printf("Grain %s already exists locally, exists on (%s)\n", id, host) log.Printf("Grain %s already exists locally, owner is (%s)\n", id, host)
p.mu.Lock() p.mu.Lock()
delete(p.local.grains, id) delete(p.local.grains, id)
p.mu.Unlock() p.mu.Unlock()
@@ -321,7 +320,7 @@ func (p *SyncedPool) RequestOwnership(id CartId) error {
ok := 0 ok := 0
all := 0 all := 0
for _, r := range p.remotes { for _, r := range p.remotes {
// log.Printf("Confirming change of %s to %s (me) with %s\n", id, p.Hostname, r.Host) log.Printf("Asking for confirmation change of %s to %s (me) with %s\n", id, p.Hostname, r.Host)
err := r.ConfirmChange(id, p.Hostname) err := r.ConfirmChange(id, p.Hostname)
all++ all++
if err != nil { if err != nil {