Skip to content

Commit

Permalink
more logs without debug tag
Browse files Browse the repository at this point in the history
  • Loading branch information
glutamatt committed Sep 6, 2024
1 parent 4a51aa8 commit 3418a09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 5 additions & 6 deletions connectionpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ func (pool *hostConnPool) Size() int {

// Close the connection pool
func (pool *hostConnPool) Close() {
pool.logger.Printf("closing hostConnPool of %q", pool.host)
pool.mu.Lock()
defer pool.mu.Unlock()

Expand Down Expand Up @@ -441,9 +442,8 @@ func (pool *hostConnPool) logConnectErr(err error) {
// transition back to a not-filling state.
func (pool *hostConnPool) fillingStopped(err error) {
if err != nil {
if gocqlDebug {
pool.logger.Printf("gocql: filling stopped %q: %v\n", pool.host.ConnectAddress(), err)
}
pool.logger.Printf("gocql: filling stopped %q: %v\n", pool.host.ConnectAddress(), err)

// wait for some time to avoid back-to-back filling
// this provides some time between failed attempts
// to fill the pool for the host to recover
Expand All @@ -459,9 +459,8 @@ func (pool *hostConnPool) fillingStopped(err error) {

// if we errored and the size is now zero, make sure the host is marked as down
// see https://github.com/gocql/gocql/issues/1614
if gocqlDebug {
pool.logger.Printf("gocql: conns of pool after stopped %q: %v\n", host.ConnectAddress(), count)
}
pool.logger.Printf("gocql: conns of pool after stopped %q: %v", host.ConnectAddress(), count)

if err != nil && count == 0 {
if pool.session.cfg.ConvictionPolicy.AddFailure(err, host) {
pool.session.handleNodeDown(host.ConnectAddress(), port)
Expand Down
5 changes: 1 addition & 4 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ func (s *Session) handleNodeConnected(host *HostInfo) {
}

func (s *Session) handleNodeDown(ip net.IP, port int) {
if gocqlDebug {
s.logger.Printf("gocql: Session.handleNodeDown: %s:%d\n", ip.String(), port)
}

s.logger.Printf("gocql: Session.handleNodeDown: %s:%d", ip.String(), port)
host, ok := s.ring.getHostByIP(ip.String())
if ok {
host.setState(NodeDown)
Expand Down

0 comments on commit 3418a09

Please sign in to comment.