Repository navigation
fs: fix --bwlimit timetables written out of order using the wrong limit - #9987
Merged
Merged
Conversation
Until the first time slot of the week, the timetable used its last entry as the limit carried over from the week before. That is only the latest slot of the week when the entries are in order, so a timetable written weekend first, like "Sat-00:00,off Mon-00:00,1M", limited Sunday to 1M instead of leaving it unlimited. Carry over the latest time slot of the week instead.
It was missing a space between two entries, so it didn't parse.
This file contains hidden or 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
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 does this change do?
Before the first time slot of the week,
LimitAtfalls back to the last entry of the timetable as the limit carried over from the previous week. That's only right when the entries are in week order, so the same timetable gives different limits depending on how it's written:Writing the weekend first is a natural way to say "unlimited at weekends", and it throttles Sunday morning. Weekday-less entries hit it too:
"12:00,1M Mon-00:00,512"gives 512Ki at Sunday 10:00, where the most recent slot is Saturday 12:00.The fallback is now the latest slot in the week, which is the same entry as before whenever the timetable is in order, so only out-of-order timetables change.
The second commit fixes the expanded example in the
--bwlimitdocs, which was missing a space (512Mon-12:00) and didn't parse.Tests: new case in
TestBwTimetableLimitAtwith the weekend-first timetable, which returns the Monday slot on master.make quicktestmatches master (cmd/gitannexfails on both, nogit-annexhere) andgolangci-lint run ./fs/reports 0 issues.Linked issue
None.
Checklist