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

Fix amq router race condition #59

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Fix amq router race condition #59

merged 1 commit into from
Dec 2, 2022

Conversation

jzding
Copy link
Member

@jzding jzding commented Dec 2, 2022

Add retries when starting AMQP server to deal with the race condition when AMQP router starts later than cloud-event-proxy service, for example when a node is rebooted.

Timeout for retry duration is set to 30 seconds.

Signed-off-by: Jack Ding [email protected]

Add retries when starting AMQP server to deal with the race
condition when AMQP router starts later than cloud-event-proxy
service, for example when a node is rebooted.

Signed-off-by: Jack Ding <[email protected]>
if instance == nil || instance.Router == nil {
return nil, errorhandler.AMQPConnectionError{Desc: "amqp connection error"}
return nil, errorhandler.AMQPConnectionError{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removed description ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text might be used for parsing some where

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AMQPConnectionError itself already has description.
Before removing description:

ERRO[0000] error starting amqp at amqp:localhost:5672 error: amqp connection error amqp connection error
WARN[0000] requires QPID router installed to function fully amqp connection error amqp connection error

After removing description:

ERRO[0000] error starting amqp at amqp:localhost:5672 error: amqp connection error
WARN[0000] requires QPID router installed to function fully amqp connection error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@jzding jzding merged commit 6d25e1b into redhat-cne:main Dec 2, 2022
@jzding
Copy link
Member Author

jzding commented Dec 2, 2022

/cherrypick release-4.12

@jzding
Copy link
Member Author

jzding commented Dec 2, 2022

/cherry-pick release-4.12

@jzding jzding deleted the amq-race branch December 12, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants