I get the following error when attempting to use this new is_server_alive()
method:
2015-02-07 00:13:36 +0000 connecting to Kafka broker at localhost:9092
2015-02-07 00:13:36 +0000 $VAR1 = bless( {
'_IO_cache' => {
'localhost:9092' => {
'port' => '9092',
'host' =>
'localhost',
'IO' => undef,
'NodeId' => undef
}
},
'broker_list' => [],
'_metadata' => {},
'AutoCreateTopicsEnable' => 0,
'host' => 'localhost',
'SEND_MAX_ATTEMPTS' => '1',
'MaxLoggedErrors' => 100,
'CorrelationId' => '-1842022702',
'timeout' => '1.5',
'_leaders' => {},
'port' => 9092,
'_nonfatal_errors' => [],
'RECEIVE_MAX_ATTEMPTS' => 4,
'RETRY_BACKOFF' => '200'
}, 'Kafka::Connection' );
[Sat Feb 7 00:13:36 2015 ] name = 'localhost', number of wallclock seconds
= 2
[Sat Feb 7 00:13:36 2015 ] _connect: ip = '127.0.0.1, error = '', $? = 0,
$! = ''
[Sat Feb 7 00:13:36 2015 ] _connect: 10 (remaining) - 0 (elapsed) = 10
[Sat Feb 7 00:13:36 2015 ] _connect: remaining - elapsed > 0 (to alarm
restart)
[Sat Feb 7 00:13:36 2015 ] _connect: after alarm 'recalled'
Error: Can't call method "is_alive" on an undefined value at
/Library/Perl/5.18/Kafka/Connection.pm line 569.
This looks like a bug when attempting to connect to a single kafka broker
that isn't online, IO handle doesn't get set and then attempts to do
$io->is_alive when $io is undef instead of an object?
Using is_server_connected() does return false in the scenario however.
Best Regards,
Hari Sekhon
http://www.linkedin.com/in/harisekhon
On 5 February 2015 at 00:00, Sergey Gladkov via RT <bug-Kafka@rt.cpan.org>
wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=101591 >
>
> Hi,
>
> We have prepared a new version 0.8009_1 .
>
> CHANGES:
> - Method Kafka::Connection->is_server_alive renamed to is_server_connected
> .
> - New Kafka::Connection->is_server_alive method properly checks for
> availability of Kafka server.
>
> Best Regards,
> Sergey Gladkov
>
>