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

Drop of the downstream messages #575

Closed
2 tasks done
lexfrei88 opened this issue Feb 12, 2021 · 1 comment · Fixed by #577
Closed
2 tasks done

Drop of the downstream messages #575

lexfrei88 opened this issue Feb 12, 2021 · 1 comment · Fixed by #577

Comments

@lexfrei88
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

What happened?

Only one of multiple downstream messages is handled if they will appear in MQTT with a delay of less than 100ms (all messages to the same device)

What did you expect?

All downstream message handled

The issue I believe in here mqtt.go#txPayloadHandler:

	// Since with MQTT all subscribers will receive the downlink messages sent
	// by the application, the first instance receiving the message must lock it,
	// so that other instances can ignore the message.
	key := fmt.Sprintf("lora:as:downlink:lock:%d:%s", pl.ApplicationID, pl.DevEUI)
	set, err := storage.RedisClient().SetNX(key, "lock", downlinkLockTTL).Result()
	if err != nil {
		log.WithError(err).Error("integration/mqtt: acquire lock error")
		return
	}

Two messages will be considered different only if they send to different devices. Why this code can't take into account the content of these messages? That would help to avoid duplications but make it possible to process different messages that came too often

Component Version
Application Server v3.10.0
@brocaar
Copy link
Owner

brocaar commented Feb 15, 2021

Yes, I agree. Would you like to create a PR for this?

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