Skip to content
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

IdempotentRequestCache: Remove request timeout #9581

Conversation

kiminuo
Copy link
Collaborator

@kiminuo kiminuo commented Nov 20, 2022

Depends on #9577

This is an idea how to fix: #9469 (comment)

The idea is simply to remove private static TimeSpan RequestTimeout { get; } = TimeSpan.FromMinutes(5); from IdempotencyRequestCache and move it simply to the callers that need it.

Comment on lines +49 to +50
using CancellationTokenSource timeoutCts = new(RequestTimeout);
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have deliberately copy&pasted these two lines to ConfirmConnectionAsync and other methods because if I were to use a method it would be very generic method and probably harder to understand.

That can be still done if you find it better.

responseTcs.SetException(!timeoutCts.IsCancellationRequested
? e
: new InvalidOperationException("DeadLock prevention timeout kicked in!", e));
responseTcs.SetException(e);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the main change. The rationale behind this change is: Whatever request timeout we choose, it's certainly not good enough for application-wide use.

So then we can just leaving it up to users of Idempotency Request Cache to specify a timeout they need OR don't specify any timeout at all (block fetching shows that we might wait very long time).

Copy link
Collaborator

@molnard molnard left a comment

Choose a reason for hiding this comment

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

cACK

@kiminuo kiminuo marked this pull request as ready for review November 28, 2022 11:53
@kiminuo kiminuo requested a review from molnard November 28, 2022 11:54
@molnard molnard merged commit 0ecb701 into WalletWasabi:master Nov 29, 2022
@kiminuo kiminuo deleted the feature/2022-11-19-IdempotentRequestCache-remove-request-timeout branch November 29, 2022 11:56
kiminuo pushed a commit to kiminuo/WalletWasabi that referenced this pull request Nov 30, 2022
…IdempotentRequestCache-remove-request-timeout

`IdempotentRequestCache`: Remove request timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERROR: DeadLock prevention timeout kicked in! (GUI frozen/dead)
2 participants