implement per-wallet lock quota and rate limit#1794
Conversation
| if _, lockErr := s.locker.LockWithIdentity(ctx, &t.Id, s.txID, id, reclaim); lockErr != nil { | ||
| // Check if this is a quota or rate limit error - these should not be retried | ||
| if errors.HasType(lockErr, ErrQuotaExceeded) || errors.HasType(lockErr, ErrRateLimitExceeded) { | ||
| s.locker.UnlockIDs(ctx, toBeSpent...) |
There was a problem hiding this comment.
When these locks where taken and why we need to unlock them?
There was a problem hiding this comment.
locks are locked in line 126 in the loop.
if something goes wrong we unlock all those we have locked
| s.locker.UnlockIDs(ctx, toBeCertified...) | ||
|
|
||
| return nil, nil, lockErr | ||
| } |
There was a problem hiding this comment.
Do we have a test that check this logic?
There was a problem hiding this comment.
added now more tests
5dc92c7 to
1ba6c8c
Compare
|
if I understand correctly the concerns of the issue this PR is trying to address, the selector service needs to have a definition of a |
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
ac91de5 to
e9ee112
Compare
implement per-wallet lock quota and rate limit.
Addresses issue #1640