-
Notifications
You must be signed in to change notification settings - Fork 83
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: Add locking around MQTT client setup and around connecting to avoid race conditions. #474
Conversation
LGTM, but should we also fix the MQTTSend (mqtt.go)? |
Yes, once I have a chance to run this one through real tests. |
8606d82
to
1609e27
Compare
@cloudxxx8 , Added locking to MqttSend and also recheck conditions after locks to make sure still need to do the actions. |
recheck |
…oid race conditions. closes #471 Signed-off-by: lenny <[email protected]>
@lenny-intel I tested your fixing with my use case and it works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
recheck |
@lenny-intel we opened this issue edgexfoundry/app-service-configurable#108 because we encountered the race condition in MQTTSend |
Sorry, I just noticed it has been fixed in MQTTSend, too. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
race case exist when setting up and connecting to the MQTT export client
Issue Number: #471
What is the new behavior?
Mutex locks added around setting up and connecting to the MQTT export client
Does this PR introduce a breaking change?
Are there any new imports or modules? If so, what are they used for and why?
No
Are there any specific instructions or things that should be known prior to reviewing?
Other information