Tags: cirello-io/dynamolock
Tags
dynamolock/v2: introduce individual timeouts to automatic heartbeats In the process of investigating #446, the issue reporters uncovered that heartbeats were using a context.Background(). When the public interface got refactored to use contexts (with the upgrade to AWS Go SDK v2), this particular part of the code remained untouched by me. In the same issue, the reporter claims that SessionMonitors are flaky. I could not reproduce the problem in my own environment, by as a policy I assumed the report is accurate. In a world in which this problem does happen, one of the sources of the misbehavior would be the fact that Heartbeats would take too long to execute, holding the lock longer than it should, and effectively derailing the test inside SessionMonitor code. In this situation, when it finally came around, the lock would be already lost and the session monitor would've never been called. This commit attempts to address this issue by introducing individual timeouts to each SendHeartbeat call. As this change was being iterated, I could see that the locks heartbeat loop could take very long to run. In the past it was possible to get away with it because all locks would get a chance, with this change though, it runs on a time budget and they have to run as quickly as possible within c.heartbeatPeriod. This commit also adds specific tests cases that attempt to replicate the network connectivity issue declared in #446 (refer to TestSessionMonitorMissedCall).
dynamolock: improve cancelability of acquireLock When acquireLock() begins sleeping before a retry, it previously would not return until after the full sleep interval had elapsed, which would cause the caller to block for up to the configurable refresh period even after cancellation. This change allows immediate return should the context be cancelled while sleeping. Addresses #106
build(deps): bump github.com/aws/aws-sdk-go from 1.23.4 to 1.23.7 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.23.4 to 1.23.7. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-go@v1.23.4...v1.23.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
PreviousNext