php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59708 Unexpected exit code 1 with AMQPQueue::consume()
Submitted: 2011-04-11 10:31 UTC Modified: 2011-05-31 15:49 UTC
From: alexei dot shulga at gmail dot com Assigned:
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.3 OS: Ubuntu 10.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alexei dot shulga at gmail dot com
New email:
PHP Version: OS:

 

 [2011-04-11 10:31 UTC] alexei dot shulga at gmail dot com
Description:
------------
Server: Ubuntu 10.10 with RabbitMQ (latest) from RabbitMQ Deb 
package (apt source)

Client: Ubuntu 10.10 (installed with pecl)

Consume forces the script to stop with the exit code 1.

Reproduce code:
---------------
<?php

$connection = new AMQPConnection();

// Here goes connection data - host, user, password

$connection->connect();

$queue = new AMQPQueue($connection);

$queue->declare('testqueue');

$options = array(
 'min' => 1,
 'max' => 10,
 'ack' => true
);

$messages = $queue->consume($options);

// rest of the code

Expected result:
----------------
Script executes till the end.

Actual result:
--------------
Message: Process finished with exit code 1
Script stops.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-11 10:37 UTC] alexei dot shulga at gmail dot com
Forgot to mention - the get() method works fine and gets what 
it has to, so it's not connection specific or any other 
issues.
 [2011-04-12 05:45 UTC] jacolmode at wp dot pl
The same thing happens on my system:

ubuntu 10.10
rabbitmq-server 2.4.1-1
librabbitmq 1.0-1
php5-amqp 0.2.2-1
 [2011-04-17 15:42 UTC] kissifrot at gmail dot com
Same happens with dotdeb PHP 5.3.5/5.3.6 and Debian Lenny, using the latest librabbitmq version.
 [2011-04-18 03:02 UTC] kissifrot at gmail dot com
However with latest version (2011-04-14)
$queue->consume()
works, but
$queue->consume($options)
with any value in options gets the exit code 1
 [2011-04-20 18:46 UTC] swestcott at gmail dot com
Ubuntu Natty
AMQP 0.2.2 (latest release)
rabbitmq-server 2.4.1-1

Executing the example code at 
http://uk3.php.net/manual/en/amqp.examples.php causes the 
script to abort on the $q->consume() call with exit code 1.
 [2011-04-22 16:58 UTC] swestcott at gmail dot com
The example code in the manual works against trunk (r955767).
 [2011-04-23 21:58 UTC] avip at hotmail dot com
I can confirm the same behaviour: consume() with or without 
options will exit 1 whereas get() works. Debian 2.6.18, PHP 
5.3.3
 [2011-05-31 15:49 UTC] dsmflyer at gmail dot com
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Fixed memory leaks in consume so that php does not seg fault.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 01:03:38 2021 UTC