Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 68bb765

Browse files
committed
occasional channel issues on disconnect events
Really really really need to clean this up soon...for now just make new channels when we switch backend server connections.
1 parent 58ea2ed commit 68bb765

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

proxy.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,14 @@ func handleBoltConn(client bolt.BoltConn, b *backend.Backend) {
357357
log.Println("no established connection for host", host)
358358
return
359359
}
360-
361360
log.Printf("grabbed conn for %s-access to db %s on host %s\n", mode, db, host)
361+
362+
// TODO: refactor channel handling...probably have handleTx() return new ones
363+
// instead of reusing the same ones. If we don't create new ones, there could
364+
// be lingering halt/ack messages. :-(
365+
halt = make(chan bool, 1)
366+
ack = make(chan bool, 1)
367+
362368
// kick off a new tx handler routine
363369
go handleTx(client, server, ack, halt)
364370
startingTx = false

0 commit comments

Comments
 (0)