Changeset 382

Show
Ignore:
Timestamp:
08/25/06 03:49:54 (2 years ago)
Author:
marksmith
Message:

* don't let the query workers do anything if they haven't heard from

the monitoring job yet

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/server-newrepl/lib/MogileFS/ProcManager.pm

    r377 r382  
    652652sub send_monitor_has_run { 
    653653    my $child = shift; 
    654     for my $type (qw(replicate checker)) { 
     654    for my $type (qw(replicate checker queryworker)) { 
    655655        MogileFS::ProcManager->ImmediateSendToChildrenByJob($type, ":monitor_has_run", $child); 
    656656    } 
  • branches/server-newrepl/lib/MogileFS/Worker/Query.pm

    r376 r382  
    166166                                         undef, $dmid, $class) 
    167167            or return $self->err_line("unreg_class"); 
     168    } 
     169 
     170    # if we haven't heard from the monitoring job yet, we need to chill a bit 
     171    # to prevent a race where we tell a user that we can't create a file when 
     172    # in fact we've just not heard from the monitor 
     173    while (! $self->monitor_has_run) { 
     174        $self->read_from_parent; 
     175        $self->still_alive; 
     176        sleep 1; 
    168177    } 
    169178