[Feature] Add clock skew computation and unit test - #3898
Open
kai-ion wants to merge 1 commit into
Open
Conversation
kai-ion
marked this pull request as ready for review
August 26, 2026 19:43
sbiscigl
reviewed
Aug 26, 2026
kai-ion
force-pushed
the
timechange
branch
2 times, most recently
from
August 28, 2026 14:51
c299fbb to
6214afe
Compare
sbiscigl
approved these changes
Aug 28, 2026
| // Retryable when the applied skew is off from the observed skew by more than the threshold. | ||
| if (candidate.has_value()) | ||
| { | ||
| const std::chrono::milliseconds delta = attemptSkew - candidate.value(); |
Collaborator
There was a problem hiding this comment.
ok im sort of split on this, nice to have wont block it, the reason you are doing all of this is because std::chrono::abs is in c++17. i sort of hate we are forced to do this the wrong way. so a suggestion. in aws/core/utils/local you could add Chrono.h and have something like
namespace Aws {
#if defined(__cpp_lib_chrono) && __cpp_lib_chrono >= 201510L
using std::chrono::abs;
using std::chrono::ceil;
using std::chrono::floor;
using std::chrono::round;
#else
// TODO: delete this branch once the minimum standard is C++17.
template <class Rep, class Period>
constexpr std::enable_if_t<std::numeric_limits<Rep>::is_signed,
std::chrono::duration<Rep, Period>>
abs(std::chrono::duration<Rep, Period> d) {
return d >= d.zero() ? d : -d;
}
#endif
}then here you could just call Aws::chrono::abs, and if you compile with 17 you get the feature, if you compile without you get the shim implementation.
Add clock skew correction computation and unit test
sbiscigl
approved these changes
Aug 28, 2026
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.
Issue #, if available:
Description of changes:
Add clock skew computation and unit test
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.