CC: | "Secana Support" <secanasupport [...] experian-scorex.no> |
Subject: | MQSeries/Queue.pm - close program error patch |
Date: | Fri, 6 Feb 2009 10:51:59 +0100 |
To: | <bug-MQSeries [...] rt.cpan.org> |
From: | Morten Bjørnsvik <morten.bjornsvik [...] experian-da.no> |
Hi
$ /opt/perl/bin/perl -e 'use MQSeries; print $MQSeries::VERSION."\n";'
1.28
Our MQ-Connector spits out this messages from time to time. I've traced it down to being
queuemanagers that we already have closed all active connections on when program exits or
queues that have never been used.
Use of uninitialized value in subroutine entry at /opt/perl/lib/site_perl/5.10.0/x86_64-linux/MQSeries/Queue.pm line 264 during global destruction.
There is no need to execute MQCLOSE if $self->{QueueManager}->{Hconn} is not defined. Just return.
Enclosed is a 2liners patch:
# cat MQSeries_Queue.pm_v.128b.patch
--- Queue.pm_orig 2009-02-06 10:05:54.000000000 +0100
+++ Queue.pm 2009-02-06 10:22:54.000000000 +0100
@@ -260,6 +260,8 @@
$self->{CloseOptions} = $args{Options};
}
+ # in case Connector not established no need to close
+ return if(! defined $self->{QueueManager}->{Hconn});
MQCLOSE(
$self->{QueueManager}->{Hconn},
$self->{Hobj},
Thanks
--
Morten Bjørnsvik
Experian Decision Analytics AS
PB 121, 0102 Oslo, Norway
Morten.bjornsvik@experian-da.no