[Spread-users] bug?
Jonathan Stanton
jonathan at cnds.jhu.edu
Wed Mar 30 13:11:33 EST 2005
Quick answer. Program A needs to either:
1) set the SELF_DISCARD flag on it's messages it sends so spread does
not try to deliver the messages back to A; or
2) not join the group, but just send the messages. In spread you do not
have to join a group in order to send messages to it.
The cause is that spread is delivering all of the messages to A also,
but program A is not receiving those messages so after buffering a fixed
number (a few thousand) it cuts off program A from the daemon because it
is not reading fast enough.
Cheers,
Jonathan
On Wed, Mar 30, 2005 at 03:23:59PM +0400, Ivan Kolosovskiy wrote:
> Hello, spread-users.
>
> Sorry for bad english, it's not my native language.
>
> Problem:
> Computers A and B (FreeBSD, latest Spread) united in spread group.
> Computer A runs perl program, that generates messages in the Spread
> group. Computer B runs perl program, that listens to the Spread group
> and prints recieved messages. When Computer A sends a certain amount
> of messages(depends on message size), computer B recieved message,
> that computer A leaved group and computer B recieves error
> "Connection Closed".
>
> computer A:
> =========================
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Spread;
>
>
> my($service_type, $sender, $groups, $mess_type, $endian, $message);
> my($messsize,$i,$c,$size,$ts);
> $ts=0;
> my($mailbox, $private_group) = Spread::connect(
> { spread_name => '4803 at vsemtest1.agava-guns.domain',
> private_name => 'vsem1', }
> );
>
> Spread::join($mailbox, 'LOG');
>
> Spread::multicast($mailbox, AGREED_MESS, 'LOG', 0, "Hey you!");
>
>
> while (1) {
> for ( $i = 0; $i < 100; $i++) {
> $size = Spread::multicast($mailbox, UNRELIABLE_MESS, 'LOG', 0, "BUUUU!BUUUU!BUUUU!BUUUU!");
> print "Failed multicast: $sperrno\n!" unless $size;
> $c++; $ts += $size;
> }
> sleep 1;
> while( not $messsize = Spread::poll($mailbox) ) {
> ($service_type, $sender, $groups, $mess_type, $endian, $message) =
> Spread::receive($mailbox);
> print" Service type: $service_type \n"
> ."Sender: $sender\nGroups: @{$groups}\n"
> ."Message type: $mess_type\nEndian: $endian\n"
> ."Message: $message\n\n";
> sleep 5;
> die unless $size;
> }
>
>
> print "$c messages, $ts bytes sent\n";
>
> }
> ================================
>
> computer B:
> =========================
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Spread;
>
>
> my($service_type, $sender, $groups, $mess_type, $endian, $message);
> my($messsize);
> my($mailbox, $private_group) = Spread::connect(
> { spread_name => '4803 at vsemtest2.agava-guns.domain',
> private_name => 'vsem2', }
> );
>
>
> Spread::join($mailbox, 'LOG');
>
> while(1) {
> ($messsize) = Spread::poll($mailbox);
> if(defined($messsize)) { print "Next message: $messsize bytes\n"; }
> else { print "Spread::poll $sperrno\n"; }
> if ($messsize > 0 ) {
> ($service_type, $sender, $groups, $mess_type, $endian, $message) =
> Spread::receive($mailbox);
> print" Service type: $service_type \n"
> ."Sender: $sender\nGroups: @{$groups}\n"
> ."Message type: $mess_type\nEndian: $endian\n"
> ."Message: $message\n\n";
> }
> sleep 2 unless $messsize;
> }
> ================================
>
>
>
> --
> С уважением,
> Ivan mailto:agava-develop at yandex.ru
>
>
>
> _______________________________________________
> Spread-users mailing list
> Spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users
--
-------------------------------------------------------
Jonathan R. Stanton jonathan at cs.jhu.edu
Dept. of Computer Science
Johns Hopkins University
-------------------------------------------------------
More information about the Spread-users
mailing list