From: miker Date: Fri, 21 Apr 2006 19:08:17 +0000 (+0000) Subject: debuging changes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8976d706305ad1abe5915d4879c631c2e8f8e50f;p=opensrf%2Fbjwebb.git debuging changes git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@704 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/AppSession.pm b/src/perlmods/OpenSRF/AppSession.pm index caf6b05..0ed1271 100644 --- a/src/perlmods/OpenSRF/AppSession.pm +++ b/src/perlmods/OpenSRF/AppSession.pm @@ -754,7 +754,7 @@ sub push_resend { sub flush_resend { my $self = shift; - $logger->debug( "Resending..." . @_RESEND_QUEUE, DEBUG ); + $logger->debug( "Resending..." . @_RESEND_QUEUE, INTERNAL ); while ( my $req = shift @OpenSRF::AppSession::_RESEND_QUEUE ) { $req->resend unless $req->complete; } @@ -765,7 +765,7 @@ sub queue_wait { my $self = shift; if( ! $self->{peer_handle} ) { return 0; } my $timeout = shift || 0; - $logger->debug( "Calling queue_wait($timeout)" , DEBUG ); + $logger->debug( "Calling queue_wait($timeout)" , INTERNAL ); my $o = $self->{peer_handle}->process($timeout); $self->flush_resend; return $o; @@ -906,7 +906,7 @@ sub failed { sub queue_wait { my $self = shift; - OpenSRF::Utils::Logger->debug( "Calling queue_wait(@_)", DEBUG ); + OpenSRF::Utils::Logger->debug( "Calling queue_wait(@_)", INTERNAL ); return $self->session->queue_wait(@_) } diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index efd77a6..3d23bd8 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -181,7 +181,7 @@ sub handler { warn "Done running...\n"; my $time = sprintf '%.3f', time() - $start; - $log->debug( "Method duration for {$method_name}: ". $time ); + $log->debug( "Method duration for [$method_name]: ". $time ); if( defined( $resp ) ) { $appreq->respond_complete( $resp ); } else { @@ -257,7 +257,7 @@ sub handler { my $start = time; my $response = $aref->[2]->run( $aref->[0], @{$aref->[1]} ); my $time = sprintf '%.3f', time - $start; - $log->debug( "Method duration for {[".$aref->[2]->api_name." -> ".join(', ',@{$aref->[1]}).'}: '.$time, DEBUG ); + $log->debug( "Method duration for [".$aref->[2]->api_name." -> ".join(', ',@{$aref->[1]}).']: '.$time, DEBUG ); $appreq = $aref->[0]; if( ref( $response ) ) { @@ -286,6 +286,8 @@ sub handler { return 1; } + $log->info("Received non-REQUEST message in Application handler"); + my $res = OpenSRF::DomainObject::oilsMethodException->new( status => "Received non-REQUEST message in Application handler"); $session->send('ERROR', $res); diff --git a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm index fc0a299..1ad6de4 100644 --- a/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm +++ b/src/perlmods/OpenSRF/DomainObject/oilsMessage.pm @@ -300,6 +300,9 @@ sub do_client { # add more STATUS handling code here (as 'elsif's), for Message layer status stuff + #$session->state( $session->DISCONNECTED() ); + #$session->reset; + } elsif ($session->state == $session->CONNECTING()) { # This should be changed to check the type of response (is it a connectException?, etc.) } diff --git a/src/perlmods/OpenSRF/MultiSession.pm b/src/perlmods/OpenSRF/MultiSession.pm index 97c8917..6a02476 100644 --- a/src/perlmods/OpenSRF/MultiSession.pm +++ b/src/perlmods/OpenSRF/MultiSession.pm @@ -60,7 +60,9 @@ sub _dummy_session_hash_function { sub connect { my $self = shift; - $_->connect for (@{$self->{sessions}}); + for my $ses (@{$self->{sessions}}) { + $ses->connect unless ($ses->connected); + } } sub finish {