-
-
Save smls/3c59b3f818d27f3854852afd361e9b95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
## Uncommenting the following line makes the bug disappear: | |
# my $*SCHEDULER = CurrentThreadScheduler; | |
## Set up a test folder with 26 empty files. | |
my $folder = "/tmp/concurrent_dir_bug".IO; | |
$folder.mkdir; | |
$folder.child("$_$_$_").spurt("") for "a".."z"; | |
## Read the folder from multiple threads, and sanity-check each IO::Path. | |
## The sanity check should never fail, but at some point it does. | |
await do for ^20 { | |
start { | |
for $folder.dir -> $path { | |
if $path.absolute ne $path.Str { | |
die join "\n", <Str absolute gist perl>.map: { | |
"{.fmt: '%9s'}: {$path."$_"()}" | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Str: /tmp/concurrent_dir_bug/sss | |
absolute: /tmp/concurrent_dir_bug/vvv | |
gist: "/tmp/concurrent_dir_bug/vvv".IO | |
perl: "/tmp/concurrent_dir_bug/vvv".IO(:SPEC(IO::Spec::Unix)) | |
in block <unit> at /home/sam/dev/concurrent_dir_bug.p6 line 13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment