Skip Menu |

This queue is for tickets about the Kafka CPAN distribution.

Report information
The Basics
Id: 101591
Status: resolved
Priority: 0/
Queue: Kafka

People
Owner: SGLADKOV [...] cpan.org
Requestors: harisekhon [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.8009_1



Subject: Kafka $connection->is_server_alive() returns undef until broker has been used
Date: Sat, 17 Jan 2015 18:58:06 +0000
To: bug-Kafka [...] rt.cpan.org
From: Hari Sekhon <harisekhon [...] gmail.com>
Hi, $connection->is_server_alive() returns undef even after connection + producer + consumer are instantiated, probably because of deferred connection. It does return 1 as expected after doing an action such as fetching latest Kafka offset. Is this expected behaviour? Can we have that method call actually actively check if the Kafka broker is alive? Best Regards, Hari Sekhon http://www.linkedin.com/in/harisekhon
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
Subject: Re: [rt.cpan.org #101591] Kafka $connection->is_server_alive() returns undef until broker has been used
Date: Sat, 7 Feb 2015 13:01:06 +0000
To: bug-Kafka [...] rt.cpan.org
From: Hari Sekhon <harisekhon [...] gmail.com>
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 > >
Subject: Re: [rt.cpan.org #101591] Kafka $connection->is_server_alive() returns undef until broker has been used
Date: Sat, 7 Feb 2015 13:04:23 +0000
To: bug-Kafka [...] rt.cpan.org
From: Hari Sekhon <harisekhon [...] gmail.com>
Correction is_server_connected() seems to always return false whether I point it to a server that is up or down... when using 0.8010 version of the library. This seems like another bug? Best Regards, Hari Sekhon http://www.linkedin.com/in/harisekhon On 7 February 2015 at 13:01, Hari Sekhon <harisekhon@gmail.com> wrote: Show quoted text
> 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: >
>> <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 >> >>
>
I'm not able to reproduce such behavior, could you provide more information about your environment (kafka version, your platform, java version, perl version, etc) as well as steps to re-produce?
Show quoted text
> Correction is_server_connected() seems to always return false whether I point it to a server that is up or down... when using 0.8010 version of the library. This seems like another bug?
In order to further understand what's going on please do the following: unpack distribution, set KAFKA_BASE_DIR variable to point to your kafka dir and then run : cd t 07_cluster_start.t 08_connection.t 30_cluster_stop.t Look at t/08_connection.t for is_server_connected() using examples.