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

Only 1 available server (when consistency settings requires 2) generates misleading exception #250

Closed
knocte opened this issue Jan 20, 2024 · 0 comments · Fixed by #251
Closed

Comments

@knocte
Copy link
Member

knocte commented Jan 20, 2024

Steps to reproduce:

  1. Query balance of currency X, with the bad luck that none of the servers are reachable except 1 (and the settings of this currency require 2 minimum).

Current results:

GWallet.Backend.ResultInconsistencyException: Results obtained were not enough to be considered consistent (received: 1, consistent: 1, required: 2)
   at <StartupCode$GWallet-Backend>[email protected](FinalResult`3 _arg3) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Backend/FaultTolerantParallelClient.fs:line 612
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 528
   at <StartupCode$GWallet-Backend>[email protected](AsyncActivation`1 ctxt)
   at <StartupCode$GWallet-Backend>[email protected](AsyncActivation`1 ctxt)
   at <StartupCode$GWallet-Backend>[email protected](AsyncActivation`1 ctxt)
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1167
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at Program.ProgramMainLoop[a]() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line 473
   at Program.NormalStartWithNoParameters() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line 490

Expected results:
This exception should not be raised, and FTPC should keep trying with different servers to find 1 more consistent result.

knocte added a commit that referenced this issue Jan 24, 2024
This is the first part of a bugfix for issue 250 [1]. The exception
was misleading because it was not really an inconsistecy but rather
lacking availability.

[1] #250
knocte added a commit that referenced this issue Jan 24, 2024
This is the first part of a bugfix for issue 250 [1]. The exception
was misleading because it was not really an inconsistecy but rather
lacking availability.

[1] #250
knocte added a commit that referenced this issue Jan 24, 2024
This is the first part of a bugfix for issue 250 [1]. The exception
was misleading because it was not really an inconsistecy but rather
lacking availability.

[1] #250
knocte added a commit that referenced this issue Jan 24, 2024
This is the first part of a bugfix for issue 250 [1]. The
exception was misleading because it was not really an
inconsistecy but rather lacking availability.

[1] #250
knocte added a commit that referenced this issue Jan 24, 2024
This is the first part of a bugfix for issue 250 [1]. The
exception was misleading because it was not really an
inconsistecy but rather lacking availability.

[1] #250
knocte added a commit that referenced this issue Jan 24, 2024
This InconsistentResultFromDifferentServersOfSameCurrency exception
type was introduced in [1], but after implementing an improvement[2]
over the exception message and type of another problem, I realised
that the new exception thrown in [2] wouldn't be covered by the
exception type mentioned above, so we need it to be more generic
(to receive any exception as innerException), so let's do that and
rename it.

This commit in conjunction with [2] don't really fix issue 250 [3],
but it might mitigate it, and anyway thanks to [1] if it happens
again, we will receive a different exception, with different
exception message as well, so let's close [3].

Closes #250

[1] 8fa47e0
[2] 5eca671
[3] #250
knocte added a commit that referenced this issue Jan 24, 2024
This InconsistentResultFromDifferentServersOfSameCurrency
exception type was introduced in [1], but after implementing an
improvement[2] over the exception message and type of another
problem, I realised that the new exception thrown in [2]
wouldn't be covered by the exception type mentioned above, so we
need it to be more generic (to receive any exception as
innerException), so let's do that and rename it.

This commit in conjunction with [2] don't really fix issue
250 [3], but it might mitigate it, and anyway thanks to [1] if
it happens again, we will receive a different exception, with
different exception message as well, so let's close [3].

Closes #250

[1] 8fa47e0
[2] 5eca671
[3] #250
knocte added a commit that referenced this issue Jan 24, 2024
This InconsistentResultFromDifferentServersOfSameCurrency
exception type was introduced in [1], but after implementing an
improvement[2] over the exception message and type of another
problem, I realised that the new exception thrown in [2]
wouldn't be covered by the exception type mentioned above, so we
need it to be more generic (to receive any exception as
innerException), so let's do that and rename it.

This commit in conjunction with [2] don't really fix issue
250 [3], but it might mitigate it, and anyway thanks to [1] if
it happens again, we will receive a different exception, with
different exception message as well, so let's close [3].

Closes #250

[1] 8fa47e0
[2] 5eca671
[3] #250
knocte added a commit that referenced this issue Jan 25, 2024
Backend: improve inconsistency edge case.

Closes #250
@knocte knocte closed this as completed in 41a4816 Jan 25, 2024
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 a pull request may close this issue.

1 participant