Skip to content

Cannot Start or Stop Units anymore, when nothing reads from the job completion channel #429

Open
@j-licht

Description

out <- result

The jobHandler used e.g. by Conn.StartUnitContext blocks for ever if nothing reads from the provided channel.
I think this write to the result channel should be non-blocking, like this:

	c.jobListener.Lock()
	out, ok := c.jobListener.jobs[job]
	if ok {
		select {
		case out <- result:
		default:
			fmt.Println("failed to write result to job channel")
		}
		delete(c.jobListener.jobs, job)
	}
	c.jobListener.Unlock()

I'm not sure, what is the best way to log something or if it's even necessary,

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions