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

Improve Request Queue Behavior #4 #718

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

slugzero
Copy link
Contributor

@slugzero slugzero commented Jun 8, 2023

This is the 4th PR in a series to improve the request queue behavior for sleepy end devices, as discussed in Koenkk/zigbee2mqtt#17177.

This PR introduces the following change: All new requests are attempted to be sent at least once, even when the request queue is not empty.

With the previous implementation, requests were held back until the end device checks in, but only if there is already something in the queue. This can lead to an unneccessary delay in request execution if the end device is not actually sleeping, but messages are in the queue for other reasons (e.g. temporary connection loss). For the user, this can result in end devices appearing to be unresponsive seemingly at random (e.g. Koenkk/zigbee2mqtt#1347).
The proposed change makes the send behavior consistent for all request queue sizes by always attempting to send new requests once. This means that for the "default" case of an empty queue, nothing changes. Only for non-empty queues, an additional initial send attempt is introduced. If this attempt fails, we fall back to the previous queue behavior.

@Koenkk Koenkk merged commit 68cfe55 into Koenkk:master Jun 8, 2023
1 check passed
@Koenkk
Copy link
Owner

Koenkk commented Jun 8, 2023

Thanks!

@slugzero slugzero deleted the request-queue-fixes-4 branch July 1, 2023 13:03
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.

None yet

2 participants