Skip to content

Commit

Permalink
dbus/methods: don't write blocking to jobListener channel
Browse files Browse the repository at this point in the history
When handling the jobComplete signal, only try to write to the channel
and do not block on the channel write. If nothing reads from this
channel, the function blocks forever and makes it impossible to start
new jobs.

Fixes coreos#429
  • Loading branch information
j-licht committed Oct 13, 2023
1 parent 085c827 commit 838f5a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dbus/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ func (c *Conn) jobComplete(signal *dbus.Signal) {
c.jobListener.Lock()
out, ok := c.jobListener.jobs[job]
if ok {
out <- result
select {
case out <- result:
default:
}
delete(c.jobListener.jobs, job)
}
c.jobListener.Unlock()
Expand Down

0 comments on commit 838f5a9

Please sign in to comment.