Skip to content

Commit

Permalink
Removing stale sockets while running Ansible operators (#3721)
Browse files Browse the repository at this point in the history
* Added shell command

* Changes
  • Loading branch information
VenkatRamaraju authored Aug 13, 2020
1 parent 3121021 commit 43e617e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions changelog/fragments/socket-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
entries:
- description: >
Removed stale unix sockets. This allows for smoother
initialization during the start-up of an Ansible operator,
as each operator will clean up its sockets during termination.
kind: "addition"
breaking: false
1 change: 1 addition & 0 deletions internal/ansible/runner/eventapi/eventapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (e *EventReceiver) Close() {
if err := e.server.Close(); err != nil && !errors.Is(err, os.ErrClosed) {
e.logger.Error(err, "Failed to close event receiver")
}
os.Remove(e.SocketPath)
close(e.Events)
}

Expand Down

0 comments on commit 43e617e

Please sign in to comment.