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

Heartbeat sender being a weak ref can cause the client to miss sending heartbeats #224

Open
aurban-iqmessenger opened this issue Nov 24, 2023 · 3 comments
Labels

Comments

@aurban-iqmessenger
Copy link
Contributor

aurban-iqmessenger commented Nov 24, 2023

Describe the bug

Connection is dropped shortly after success because of absent heartbeat.

Reproduction steps

  1. Update to 0.12.0
  2. Create an RMQConnection instance with some heartbeat interval, 2 seconds for example
  3. Connect
  4. In several seconds connection is closed by remote peer. Server logs report there were no heartbeats.

Expected behavior

Connection is long-lived

Additional context

Debugged this to the -[RMQConnection start:] method, upon completion of a handshake the first thing the connection does is [strongThis.heartbeatSender startWithInterval:@(heartbeatTimeout.integerValue / 2)];, but the heartbeatSender is nil. heartbeatSender was created during the initialization, though. Found it has been made weak in #194.

@michaelklishin michaelklishin changed the title Memory leaks management introduced in 0.12.0 breaks the heartbeat and connection Heartbeat sender being a weak ref can cause the client to miss sending heartbeats Nov 24, 2023
@michaelklishin
Copy link
Member

Thanks for the details.

michaelklishin added a commit that referenced this issue Nov 24, 2023
@michaelklishin
Copy link
Member

A quick attempt at a fix suggests we need to modernize the build system first a bit to work with the latest XCode on aarch64.

@kurt0615
Copy link

kurt0615 commented Apr 5, 2024

can i use rabbitmq-objc-client-224 replace version 0.12.0 for solve weak ref problem?

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

No branches or pull requests

3 participants