These are chat archives for arnaud-lb/php-rdkafka

18th
Jan 2017
Paul Dragoonis
@dragoonis
Jan 18 2017 10:03
Happy new year everyone :)
@edenhill can you spare time to look at a bug report that I'm about to file with librdkafka ? (seg fault) Happening with PHP 5.6 and PHP7
Magnus Edenhill
@edenhill
Jan 18 2017 10:04
sure
Paul Dragoonis
@dragoonis
Jan 18 2017 10:05
I'm busy gathering all info from the checklist on your "create issue" page.
Magnus Edenhill
@edenhill
Jan 18 2017 10:05
I will need a C backtrace or similar though.
Paul Dragoonis
@dragoonis
Jan 18 2017 10:05
..................FFF........S.SS..[New Thread 0x7fffdfccf700 (LWP 20884)]
[Thread 0x7fffdfccf700 (LWP 20884) exited]
[New Thread 0x7fffdfccf700 (LWP 20886)]
[Thread 0x7fffdfccf700 (LWP 20886) exited]
.......[New Thread 0x7fffdfccf700 (LWP 20887)]
[Thread 0x7fffdfccf700 (LWP 20887) exited]
[New Thread 0x7fffdfccf700 (LWP 20888)]
[Thread 0x7fffdfccf700 (LWP 20888) exited]
...........
Program received signal SIGSEGV, Segmentation fault.
0x00007fffec678a3b in rd_kafka_new () from /lib64/librdkafka.so.1
(gdb) quit
Magnus Edenhill
@edenhill
Jan 18 2017 10:05
bt
Paul Dragoonis
@dragoonis
Jan 18 2017 10:05
Do you want me to type bt to get the gdb backtrace? (it's not me running this, it's another team member)
Sure! Will do
Magnus Edenhill
@edenhill
Jan 18 2017 10:06
yah
Paul Dragoonis
@dragoonis
Jan 18 2017 11:07
@edenhill 0.92 was segfaulting, we're pulling down latest librdkafka version (runtime) => 0.9.2-257-g65c8bc and it's working OK
So you've patched it. It may be this. edenhill/librdkafka#850 - I'm getting a bt so we know what issue we ran into though. To close this off :)
Magnus Edenhill
@edenhill
Jan 18 2017 11:07
:+1:
Paul Dragoonis
@dragoonis
Jan 18 2017 11:11
@edenhill can you tell me when the next stable release is planned?
Magnus Edenhill
@edenhill
Jan 18 2017 11:12
0.9.3 is a maint release which is due in about 1-2 weeks
then there'll be a new feature release in a month or so
Paul Dragoonis
@dragoonis
Jan 18 2017 11:12
i have bt
Magnus Edenhill
@edenhill
Jan 18 2017 11:12
it'd be great if you want to test the 0.9.3.x branch to make sure the above crash is fixed
Magnus Edenhill
@edenhill
Jan 18 2017 11:17
yep
thanks for the backtrace, it didnt say much though but that's fine, you probably identified the issue anyway.
Paul Dragoonis
@dragoonis
Jan 18 2017 11:18
maybe :D We're a high level consumer now (thanks to your help ;))
        // Global config settings - see: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md#global-configuration-properties
        $conf = new ConsumerConf();
        $conf->set("enable.auto.commit", "false");
        $conf->set("socket.blocking.max.ms", 1);
        $conf->set("fetch.wait.max.ms", 10);
        $conf->set('metadata.broker.list', implode(',', $brokers));
        $conf->set('group.id', $this->generateGroupId($topicName, $partition));

        $conf->setErrorCb(function ($kafka, $err, $reason) {
            printf("Kafka error: %s (reason: %s)\n", rd_kafka_err2str($err), $reason);
        });

        $topicConf = new TopicConf();
        $topicConf->set('auto.offset.reset', 'smallest');

        $conf->setDefaultTopicConf($topicConf);

        $consumer = new HighLevelConsumer($conf);
        $consumer->assign([
            new TopicPartition($topicName, $partition, RD_KAFKA_OFFSET_STORED)
        ]);
Magnus Edenhill
@edenhill
Jan 18 2017 11:18
:100:
Paul Dragoonis
@dragoonis
Jan 18 2017 11:18
How's it looking, boss?
Magnus Edenhill
@edenhill
Jan 18 2017 11:19
looks great. That's not a balanced consumer though, just a standalone consumer since you use assign() rather than subscribe()
but that's up to you and your use-case
Paul Dragoonis
@dragoonis
Jan 18 2017 11:19
I think, based on my use-case you said I should use assign()