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

fix(mojaloop/#3750): add timer for party lookup in cache #471

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

kleyow
Copy link
Collaborator

@kleyow kleyow commented Mar 13, 2024

fix(mojaloop/#3750): add timer for party lookup in cache - mojaloop/project#3750

Details below

// The unsubscribeTimeout is used to mitigate a believed issue happening in the
// parties lookup leg of transfers. When the same party is looked up multiple times in quick
// succession, the cache is subscribed to the same channel multiple times. We believe that
// requests that have just subscribed to the channel which have not received the message yet
// are getting unsubscribed when requests that have completed call `unsubscribe`.
// This leads the request state machine to timeout the request, fail and
// stall the service. This issue is only affects parties lookup since it is the only
// pub/sub that can use the same channel name, primarily in our `ml-core-test-harness` environment.

This prevents an unsubscribe happening if a party is being constantly looked up until the requests cools down which inturn stops from the statemachines hanging then returning a 504.
Repeated party lookups for a single payee are unlikely to happen in a real world scenario but is prevelant in performance testing.

I researched methods of maybe trying to lock channel pub/sub, disregarding a rewrite of the cache implementation this is the easiest solution for the specific edgecase.

Copy link

sonarcloud bot commented Mar 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
16.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@kleyow kleyow changed the title fix: add timer for party lookup in cache fix(mojaloop/#3750): add timer for party lookup in cache Mar 13, 2024
@kleyow kleyow marked this pull request as ready for review March 13, 2024 15:48
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.

None yet

2 participants