Skip to content

Commit

Permalink
Make blocking channel for StartTransientUnit buffered
Browse files Browse the repository at this point in the history
So that, if a timeout happens and we decide to stop blocking on the
operation, the writer will not block when they try to report the result
of the operation.

This should address Issue opencontainers#1780 and it's a follow up for PR opencontainers#1683,
PR opencontainers#1754 and PR opencontainers#1772.
  • Loading branch information
filbranden committed Apr 14, 2018
1 parent f753f30 commit e2b796e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/cgroups/systemd/apply_systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (m *Manager) Apply(pid int) error {
}
}

statusChan := make(chan string)
statusChan := make(chan string, 1)
if _, err := theConn.StartTransientUnit(unitName, "replace", properties, statusChan); err == nil {
select {
case <-statusChan:
Expand Down

0 comments on commit e2b796e

Please sign in to comment.