Skip to content

Conversation

@ajbeamon
Copy link
Contributor

@ajbeamon ajbeamon commented Nov 13, 2019

Resolves #2335

@ajbeamon ajbeamon requested a review from etschannen November 13, 2019 20:50
@ajbeamon ajbeamon changed the title Limit length of delays in timeout, repeating them as necessary. Limit lifetime of timeout memory for transactions that have terminated Nov 13, 2019
@etschannen etschannen merged commit 420fc61 into apple:release-6.2 Nov 13, 2019

ACTOR Future<Void> timebomb(double endTime, Promise<Void> resetPromise) {
while(now() < endTime) {
wait( delayUntil( std::min(endTime, now() + CLIENT_KNOBS->TRANSACTION_TIMEOUT_DELAY_INTERVAL) ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, how exactly can this get stuck in a loop? I feel like delayUntil(endTime) completing should imply !(now() < endTime)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are various floating point operations that I gather could cause a delayUntil(20.0) to fire at something like 19.999999s. I agree that a better contract from delay would be nice, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also mainly a problem is simulation where delay(0) can actually happen instantly, so now()-endTime can round to 0, but now()<endTime

@ajbeamon ajbeamon deleted the limit-transaction-timeout-delay branch December 12, 2019 17:59
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.

3 participants