Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply/Supplier bug #5738

Closed
p6rt opened this issue Oct 9, 2016 · 4 comments
Closed

Supply/Supplier bug #5738

p6rt opened this issue Oct 9, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 9, 2016

Migrated from rt.perl.org#129834 (status was 'resolved')

Searchable as RT129834$

@p6rt
Copy link
Author

p6rt commented Oct 9, 2016

From liukan@360.cn

Sporadic behavior as below is observed when the following code is executed. Basically it is a situation of invoking emit for the same supplier by multiple (in this case, two) on demand supplies.

liukan@​candor​:~/Code$ cat golfed.pl6
my $out = Supplier.new;

sub watch( *@​cmd )
{
  Supply.interval( 5 ).act​: {
  my $proc = Proc​::Async.new​: |@​cmd;
  my @​rec;
  $proc.stdout.lines.act​: {
  .chars ?? @​rec.push​: $_ !! $out.emit​: @​rec.splice;
  }, done => { $out.emit​: @​rec }
  $proc.start
  }
}

$out.Supply.act​: { .say };

watch( < df -li > );
watch( < df -lm > );

sleep 100;

liukan@​candor​:~/Code$ perl6 golfed.pl6
Unhandled exception in code scheduled on thread 4
Type check failed in binding to source; expected Any but got Mu (Mu)
  in block at golfed.pl6 line 8

liukan@​candor​:~/Code$ perl6 golfed.pl6
Unhandled exception in code scheduled on thread 4
Type check failed in binding to source; expected Any but got Mu (Mu)
  in block at golfed.pl6 line 8

liukan@​candor​:~/Code$ perl6 golfed.pl6
Unhandled exception in code scheduled on thread 4
Type check failed in binding to source; expected Any but got Mu (Mu)
  in block at golfed.pl6 line 8

liukan@​candor​:~/Code$ perl6 golfed.pl6
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
[Filesystem Inodes IUsed IFree IUse% Mounted on udev 981806 591 981215 1% /dev tmpfs 986629 810 985819 1% /run /dev/sda1 30023680 429026 29594654 2% / tmpfs 986629 40 986589 1% /dev/shm tmpfs 986629 5 986624 1% /run/lock tmpfs 986629 16 986613 1% /sys/fs/cgroup tmpfs 986629 39 986590 1% /run/user/1000 Filesystem 1M-blocks Used Available Use% Mounted on
udev 3836 0 3836 0% /dev
tmpfs 771 18 754 3% /run
/dev/sda1 461539 115589 322483 27% /
tmpfs 3855 15 3840 1% /dev/shm
tmpfs 5 1 5 1% /run/lock
tmpfs 3855 0 3855 0% /sys/fs/cgroup
tmpfs 771 1 771 1% /run/user/1000]
[Filesystem 1M-blocks Used Available Use% Mounted on udev 3836 0 3836 0% /dev tmpfs 771 18 754 3% /run /dev/sda1 461539 115589 322483 27% / tmpfs 3855 15 3840 1% /dev/shm tmpfs 5 1 5 1% /run/lock tmpfs 3855 0 3855 0% /sys/fs/cgroup tmpfs 771 1 771 1% /run/user/1000]
^C

liukan@​candor​:~/Code$ perl6 -v
This is Rakudo version 2016.09-4-g31c4c6f built on MoarVM version 2016.09
implementing Perl 6.c.
liukan@​candor​:~/Code$ uname -a
Linux candor 4.4.0-38-generic #​57-Ubuntu SMP Tue Sep 6 15​:42​:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

- kan

@p6rt
Copy link
Author

p6rt commented Nov 1, 2016

From @jnthn

On Sat Oct 08 19​:08​:38 2016, liukan@​360.cn wrote​:

Sporadic behavior as below is observed when the following code is
executed. Basically it is a situation of invoking emit for the same
supplier by multiple (in this case, two) on demand supplies.

liukan@​candor​:~/Code$ cat golfed.pl6
my $out = Supplier.new;

sub watch( *@​cmd )
{
Supply.interval( 5 ).act​: {
my $proc = Proc​::Async.new​: |@​cmd;
my @​rec;
$proc.stdout.lines.act​: {
.chars ?? @​rec.push​: $_ !! $out.emit​: @​rec.splice;
}, done => { $out.emit​: @​rec }
$proc.start
}
}

$out.Supply.act​: { .say };

watch( < df -li > );
watch( < df -lm > );

sleep 100;

liukan@​candor​:~/Code$ perl6 golfed.pl6
Unhandled exception in code scheduled on thread 4
Type check failed in binding to source; expected Any but got Mu (Mu)
in block at golfed.pl6 line 8

liukan@​candor​:~/Code$ perl6 golfed.pl6
Unhandled exception in code scheduled on thread 4
Type check failed in binding to source; expected Any but got Mu (Mu)
in block at golfed.pl6 line 8

Hunted it down and got it fixed. Test in S17-procasync/stress.t.

Thanks,

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 1, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 1, 2016

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 1, 2016
@p6rt p6rt added the conc label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant