-
Notifications
You must be signed in to change notification settings - Fork 11
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: Add retry logic in "_waitForPkamAuthSuccess" to retry when secondary is temporarily not reachable #684
Merged
gkc
merged 4 commits into
trunk
from
1394-at_activate-should-retry-if-atserver-isnt-reachable
Oct 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
502d708
fix: Add retry logic in "_waitForPkamAuthSuccess" to retry when secon…
sitaram-kalluri f5e2b3f
fix: Add dart docs and modify the code
sitaram-kalluri a612f70
fix: Modify error message to fix failing functional test
sitaram-kalluri cf24f66
fix: Remove _attemptPkamAuth method and invoke pkamAuthenticate in _w…
sitaram-kalluri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
_attemptPkamAuth
throw an exception if PKAM auth fails in a "normal" way (i.e. the enrollment has not yet been approved)?Some code comments explaining what exactly is going on here would be useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
_attemptPkamAuth
method, if enrollment is denied, it returns anAtEnrollmentException
. This exception is caught in the catch block of_waitForPkamAuthSuccess
(which calls_attemptPkamAuth
),triggering the retry logic that we want to avoid. To prevent this, we need to handle
AtEnrollmentException
separately here, which introduces code duplication.To handle all the exceptions in one place, moved the existing exception handing logic in _attemptPkamAuth here. With the changes, _attemptPkamAuth do not handle exception. It rethrows and all the exceptions are handled in the _waitForPkamAuthSuccess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - I'd suggest we now remove _attemptPkamAuth and move its code inline, as _attemptPkamAuth isn't used anywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the "_attemptPkamAuth" and moved its code inline.