Skip to content

Commit

Permalink
testutils: add couple of log statements to the restartable listener t…
Browse files Browse the repository at this point in the history
…ype (#7716)
  • Loading branch information
easwars authored Oct 9, 2024
1 parent fdc2ec2 commit 18a4eac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/testutils/restartable_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func (l *RestartableListener) Addr() net.Addr {
// Stop closes existing connections on the listener and prevents new connections
// from being accepted.
func (l *RestartableListener) Stop() {
logger.Infof("Stopping restartable listener %q", l.Addr())

l.mu.Lock()
l.stopped = true
for _, conn := range l.conns {
Expand All @@ -92,6 +94,8 @@ func (l *RestartableListener) Stop() {

// Restart gets a previously stopped listener to start accepting connections.
func (l *RestartableListener) Restart() {
logger.Infof("Restarting listener %q", l.Addr())

l.mu.Lock()
l.stopped = false
l.mu.Unlock()
Expand Down

0 comments on commit 18a4eac

Please sign in to comment.