-
Notifications
You must be signed in to change notification settings - Fork 41
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
1.2.4 Version #64
Merged
Merged
1.2.4 Version #64
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will allow us to track the expected offset for each Sequence Number received, since we're sometimes getting them out-of-order.
…w always set from the upload() function This means the logic is all condensed in one place. Also, it's less code, and less repeated calls to the same function everywhere when the logic was here in the first place.
The root cause were Responses being received out-of-order than what we expected. The fix was to track which is the offset we expect for each packet sent, represented by the Sequence Number. But instead of doing it all in a single commit, we went the multiple-commit approach for a better insight into the changes.
Previously, if during Upload a package was not delivered, it'd stall the UI for up to 30 seconds (standard timeout) and then fail. Now, we detect the 'write timeout' case and retry with a much shorter duration, allowing for cases wherein a couple of missed writes / packages don't cause the entire process to fail.
The first packet send takes longer to be received because the firmware device is usually busy. Also, we allowed more time for the 'fast timeout' in case the device firmware can't keep up.
We want timeouts to be retried when they fail fast, not when they take a long time. If the device takes 30s to reply back, it's likely it won't reply after a further 60 seconds, so McuMgrBleTransport has added logic to differentiate this with a new 'fast timeout' threshold set to 10 seconds.
Perhaps our previous issues were due to the Pipelining system attempting to send too much Data before the Device could absorb it. So now, if we receive a Packet OOD, we wait until the next one we receive is the one we expect, unless the Pipeline is completely empty. From my logging attempts, this doesn't seem to happen - it's mostly a single Packet that is received OOD from time to time.
DFU is still not performing like I expected it to.
… called under thread-safe conditions This line doesn't hurt. It's only present to aid my own sanity.
We found the 5-second limit caused a DFU update to the Matter Weather Station to fail, to the point where I'm considering to remove this code. But, I know the Android side does this, so we should keep it and see if we get real world issues.
I think offset == 0 was not correct. Don't know why it shouldn't be, but then, there are so many things that don't make sense here...
Uploads look a lot more stable without 'Fast Timeout'. We can fix this later whenever we decide to come back to it.
Will we be lucky?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What we wanted to fix is the 'Missed ACK' issue which was just 'silenced' before. Now we think we have a proper / logic-level fix, but unfortunately, it looks like our zealous attempt at implementing 'fast timeout' like Android has, might've broken more things. At least that's what our constant back-and-forth which changes show, fast timeout was maybe 'too fast' under our testing, and it worked for periods of time when additional debugging code slowed it down.