Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End of file errors with PHP amqp consumer #111

Closed
thannaske opened this issue Mar 23, 2023 · 1 comment · Fixed by #128
Closed

End of file errors with PHP amqp consumer #111

thannaske opened this issue Mar 23, 2023 · 1 comment · Fixed by #128
Assignees
Labels

Comments

@thannaske
Copy link

I'm running amqproxy/0.8.6 with a PHP AMQP consumer.

After a while I can observe that the consumer stops processing messages from the queue. The processing continues after the consumer is being restarted. At the same time I can see the following errors in the amqproxy log:

2023-03-23 10:07:26 UTC: Proxy upstream: 10.10.100.33:5672
2023-03-23 10:07:26 UTC: Proxy listening on 0.0.0.0:5673
2023-03-23 12:25:33 UTC: Error reading from upstream: End of file reached (IO::EOFError)
  from usr/share/crystal/src/io.cr:523:27 in 'read_fully'
  from tmp/lib/amq-protocol/src/amq/protocol/frames.cr:26:9 in 'read_loop'
  from tmp/src/amqproxy/upstream.cr:33:7 in '->'
  from usr/share/crystal/src/fiber.cr:146:11 in 'run'
  from usr/share/crystal/src/fiber.cr:98:34 in '->'
  from ???

2023-03-23 12:45:59 UTC: Upstream connection closed when returned
2023-03-23 15:57:40 UTC: Error reading from upstream: End of file reached (IO::EOFError)
  from usr/share/crystal/src/io.cr:523:27 in 'read_fully'
  from tmp/lib/amq-protocol/src/amq/protocol/frames.cr:26:9 in 'read_loop'
  from tmp/src/amqproxy/upstream.cr:33:7 in '->'
  from usr/share/crystal/src/fiber.cr:146:11 in 'run'
  from usr/share/crystal/src/fiber.cr:98:34 in '->'
  from ???

2023-03-23 16:05:15 UTC: Upstream connection closed when returned
2023-03-23 16:09:12 UTC: Error reading from upstream: End of file reached (IO::EOFError)
  from usr/share/crystal/src/io.cr:523:27 in 'read_fully'
  from tmp/lib/amq-protocol/src/amq/protocol/frames.cr:26:9 in 'read_loop'
  from tmp/src/amqproxy/upstream.cr:33:7 in '->'
  from usr/share/crystal/src/fiber.cr:146:11 in 'run'
  from usr/share/crystal/src/fiber.cr:98:34 in '->'
  from ???

2023-03-23 16:25:56 UTC: Upstream connection closed when returned

For reference, my consumer code is pretty basic and looks like this:

$channel->queue_declare(
    queue: 'backend-callbacks',
    durable: true,
    auto_delete: false,
    arguments: $table,
);

$channel->basic_consume(
    queue: 'backend-callbacks',
    callback: [$this, 'process'],
);

while ($channel->is_consuming() && false === $this->shouldStop) {
    $channel->wait();
}

Any idea what might cause those issues?

@dentarg dentarg added the bug label May 10, 2023
@dentarg dentarg self-assigned this Sep 29, 2023
@dentarg
Copy link
Member

dentarg commented Oct 3, 2023

I think this issue is the same as #118

dentarg added a commit that referenced this issue Oct 3, 2023
This change also removes the code added in #104

The motivation behind that is

* IO:_Error that happens in Upstream#connect is raised as Upstream::Error
* IO::Error that happens in Upstream#read_loop is rescued in that method
* IO::Error that happens in Client#read_loop is raised as Client::Error

Adds an integration test with the php-amqp client run via Docker Compose
and Toxiproxy.

Close #118
Close #111
Close #98
dentarg added a commit that referenced this issue Oct 11, 2023
This change also removes the code added in #104

The motivation behind that is

* IO:_Error that happens in Upstream#connect is raised as Upstream::Error
* IO::Error that happens in Upstream#read_loop is rescued in that method
* IO::Error that happens in Client#read_loop is raised as Client::Error

Adds an integration test with the php-amqp client run via Docker Compose
and Toxiproxy.

Close #118
Close #111
Close #98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants