Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] [WIP][Keepalive] keepaliveInterval from KeepaliveReceiverInterface #59238

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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
Loading
from

Conversation

lukasz-falda
Copy link

@lukasz-falda lukasz-falda commented Dec 17, 2024

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT

TODO:

  • write PR description
  • fix tests
  • write tests
  • update CHANGELOG.md
  • submit changes to the documentation

Allow to retrieve alarm interval by receiver next to command option

For now we have to pass --keepalive option to ConsumeMessagesCommand and FailedMessagesRetryCommand to set alarm interval for application. But \AMQPQueue and amqp transport has heartbeat option. Will be nice to allow manage the keepalive interval by receiver so we can use this option and adjust alarm interval automatically by transport (maybe I will make another PR for AmqpTransport, I am working on this).

To achieve this I propose to use (new in 7.2) interface KeepaliveReceiverInterface and get keepalive interval from it. If --keepalive option was already been passed by command we shouldn't change it. Command option should be more important.

(this is my first PR in Symfony, so if I need to do anything more for now, please let me know)

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

@lukasz-falda lukasz-falda changed the title [Messenger][Keepalive] getKeepaliveInterval for KeepaliveReceiverInte… [WIP][Messenger][Keepalive] getKeepaliveInterval for KeepaliveReceiverInte… Dec 17, 2024
@lukasz-falda lukasz-falda marked this pull request as ready for review December 17, 2024 15:58
@carsonbot carsonbot added this to the 7.3 milestone Dec 17, 2024
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title [WIP][Messenger][Keepalive] getKeepaliveInterval for KeepaliveReceiverInte… [Messenger] [WIP][Keepalive] getKeepaliveInterval for KeepaliveReceiverInte… Dec 17, 2024
@lukasz-falda lukasz-falda changed the title [Messenger] [WIP][Keepalive] getKeepaliveInterval for KeepaliveReceiverInte… [Messenger] [WIP][Keepalive] keepaliveInterval from KeepaliveReceiverInterface Dec 18, 2024
@valtzu
Copy link
Contributor

valtzu commented Dec 21, 2024

As I understand the issue with this solution is that since SIGALRM is global, if with a single messenger:consume I was consuming 2 keepalive transports which both set different keepalive intervals, it would not work as intended.

@lukasz-falda
Copy link
Author

if with a single messenger:consume I was consuming 2 keepalive transports which both set different keepalive intervals, it would not work as intended.

With $minSeconds = min($minSeconds ?? $keepaliveInterval, $keepaliveInterval); we set a minimum value of all transports.
So if one transport return 5 seconds, other 10 seconds we set 5 seconds as interval.
I think this is great. If I set it manually via “--keepalive” I would also set the minimum of these values. And even if not, the proposed solution prefers “--keppalive” option so I can overwrite the values from transports at any time.

Could you go into more detail about the possible risks?

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

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.