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

MQTT sending concurrency error #471

Closed
weichou1229 opened this issue Sep 8, 2020 · 0 comments
Closed

MQTT sending concurrency error #471

weichou1229 opened this issue Sep 8, 2020 · 0 comments
Labels
3-high priority denoting release-blocking issues bug Something isn't working edinburgh fuji geneva
Milestone

Comments

@weichou1229
Copy link
Member

In high-frequency usage, the MQTT sending function might crash due to concurrent operation.

For example, the app-service receive two events and try to export data via MQTT, the first event and the second event initialize the MQTTClient concurrently and cause some network error.

Code snippets:
MQTTSender https://github.com/edgexfoundry/app-functions-sdk-go/blob/master/pkg/transforms/mqtt.go#L122
MQTTSecretSender https://github.com/edgexfoundry/app-functions-sdk-go/blob/master/pkg/transforms/mqttsecret.go#L240

if sender.client == nil || sender.secretsLastRetrieved.Before(edgexcontext.SecretProvider.SecretsLastUpdated()) {
	err := sender.initializeMQTTClient(edgexcontext)
	if err != nil {
		return false, err
	}
}
@lenny-goodell lenny-goodell added the bug Something isn't working label Sep 8, 2020
@lenny-goodell lenny-goodell added this to the Hanoi milestone Sep 8, 2020
@lenny-goodell lenny-goodell added the 3-high priority denoting release-blocking issues label Sep 8, 2020
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Sep 9, 2020
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Sep 9, 2020
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Sep 9, 2020
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3-high priority denoting release-blocking issues bug Something isn't working edinburgh fuji geneva
Projects
None yet
Development

No branches or pull requests

2 participants