php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60352 successful ack() with a broken connection
Submitted: 2011-11-21 21:28 UTC Modified: 2013-11-25 19:09 UTC
From: jacolmode at wp dot pl Assigned:
Status: Not a bug Package: amqp (PECL)
PHP Version: 5.3.8 OS: Debian/squeeze
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jacolmode at wp dot pl
New email:
PHP Version: OS:

 

 [2011-11-21 21:28 UTC] jacolmode at wp dot pl
Description:
------------
Method AMQPQueue::ack() returns true even though connection is broken (ex. 
RabbitMQ stopped suddenly).

Tested with:

php5-amqp 0.3.1-1
php5-cli 5.3.3-7+squeeze3
php5-common 5.3.3-7+squeeze3
php5-suhosin 0.9.32.1-1

php5-amqp build with librabbitmq_1.0-1.20110925

Test script:
---------------
consumer.php:
<?php
include('config.php');

$amqp = new AMQPConnection($cfg['amqp']);
$amqp->connect();

$amqp_ex = new AMQPExchange($amqp);
$amqp_ex->declare($cfg['amqp']['exchange'],AMQP_EX_TYPE_TOPIC,AMQP_DURABLE);

$amqp_qu = new AMQPQueue($amqp);
$amqp_qu->declare($cfg['amqp']['queue'],AMQP_DURABLE); 
$amqp_qu->bind($cfg['amqp']['exchange'],'slave.#');

$msgs = $amqp_qu->consume(array('min' => 1,'max' => 10,'ack' => false));

sleep(10);
var_dump($amqp_qu->ack($msgs[0]['delivery_tag'])); ?>

Expected result:
----------------
Expected bool(false) or exception.

Actual result:
--------------
root@loc:~/php-amqp-bugs/ack# php -f consumer.php & sleep 1; 
/etc/init.d/rabbitmq-server stop
[1] 11592
Stopping rabbitmq-server: rabbitmq-server.
root@loc:~/php-amqp-bugs/ack# 
root@loc:~/php-amqp-bugs/ack# bool(true)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-16 13:40 UTC] ult_raa at mail dot ru
confirmed with AMQPQueue::get() too
expected connection exception
 [2013-11-25 19:09 UTC] lstrojny@php.net
-Status: Open +Status: Not a bug
 [2013-11-25 19:09 UTC] lstrojny@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

No longer reproducable with the most recent versions.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 03:01:23 2020 UTC