Show
Ignore:
Timestamp:
05/12/08 15:12:26 (7 months ago)
Author:
kindlund
Message:

Initial fix, to deal with spinning up too many clone VMs simultaneously… not sure if threads→detach() is sane.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/trunk/lib/HoneyClient/Manager.pm

    r1559 r1576  
    769769    my @THREAD_POOL; 
    770770 
     771# TODO: Fix this. 
     772my $foo = async { 
     773threads->detach(); 
     774 
    771775    # Create the cloned VMs. 
    772776    for (my $counter = 0; $counter < getVar(name => "num_simultaneous_clones"); $counter++) { 
     
    776780            Carp::croak "Unable to create worker thread! Shutting down."; 
    777781        } 
     782 
    778783        # Push thread onto thread pool. 
    779784        push(@THREAD_POOL, $thread); 
    780     } 
     785 
     786        # TODO: Fix this. 
     787        sleep(300); 
     788    } 
     789 
     790# TODO: Fix this. 
     791}; 
    781792 
    782793    # Register the host system with the database, if need be. 
     
    837848            for (my $counter = 0; $counter < getVar(name => "num_simultaneous_clones"); $counter++) { 
    838849                my $thread = $THREAD_POOL[$counter]; 
    839                 if (!$thread->is_running()) { 
     850                if (defined($thread) && !$thread->is_running()) { 
    840851                    $LOG->error("Thread ID (" . $thread->tid() . "): Unexpectedly terminated."); 
    841852                    Carp::croak "Thread ID (" . $thread->tid() . "): Unexpectedly terminated.";