Skip Menu |
Report information
Id: 127659
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bri [at]

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: Possible race in Supply simple operations when closing Tap
Download (untitled) / with headers
text/plain 829b
In role SimpleOpTappable, the method !cleanup uses a Perl 6 int in a lock-like fashion: method !cleanup(int $cleaned-up is rw, $source-tap) { if $source-tap && !$cleaned-up { $cleaned-up = 1; $source-tap.close; } } This seems to be primarily tasked with ensuring that the &on-closed closure of the composed supply is not run more than once. A lot of the places are protected by serial supply locks, however that is not true in the case of the &on-closed of the composite Supply, nor in the .on-closed simpleop, so an absolute guarantee of this cannot be made between different closers of that Tap object, or between a single closer and an emit/done/quit. Maybe using{ once self!cleanup($source-tap) }) instead would prevent the need for $cleaned-up?

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at