Race condition when closing mults

Description

When a mult is tapped at around the same time as the source channel is closed, the tapped channel may not be closed.

The above code will sometimes return true, and sometimes return false.

Cause: This is caused by the following code in the mult function:

Any channels tapped after cs is dereferenced will not be closed.

Approach: A possible solution to this could be to always close channels tapped to a closed source. i.e.

This could be achieved by adding a flag to the cs atom to denote whether the mult is open or closed. If it's closed, any tapped channel is closed automatically.

Environment

None

Assignee

Unassigned

Reporter

import

Labels

Approval

Triaged

Patch

None

Priority

Major
Configure