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.
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
Add Authorisation and integrate sign up for users #22
Add Authorisation and integrate sign up for users #22
Changes from 13 commits
a34ded2
d5b44fc
20a8924
b146108
af96355
4bdce6a
5b6889d
3b15a20
a6953be
eab8fb9
afce972
e7b7d80
1a77019
5dea02e
35516cc
56a1da9
9fe423f
0386e58
80f9988
b3e394a
ecfdf46
e42abdf
d20539a
a7ec2c7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
get() method throws an exception if the CompletableFuture does not complete successfully. This means that if the getRDSUserData() method fails, the entire request will fail.
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.
should we handle this using timeouts? @iamitprakash, so that we don't perform the operation for too long and return TimeoutException in case of service taking higher time?
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.
If there is any exception in making the call to the RDS backend we return an exception.
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.
Use a circuit breaker. A circuit breaker is a pattern that can be used to prevent cascading failures. It works by monitoring the number of failures that occur when calling a service. If the number of failures exceeds a certain threshold, the circuit breaker will trip and all subsequent calls to the service will fail immediately. This will prevent the service from being overloaded and causing other services to fail.
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.
+1
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.
Can I push these changes in the coming PR?
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.
Since this is a bigger change, can I push in the coming PR, as @bhtibrewal and @heyrandhir changes were blocked on this PR.
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.
Here as the auth itself will not be succeded, we should try retrying to fetch the user data from the RDS backend, as circuit breaker might lead to storing of dummy data in the skill tree users db.
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.
this line throws a HttpClientErrorException with the status code HttpStatus.INTERNAL_SERVER_ERROR if any exception is thrown while calling the restTemplate.getForEntity() method. However, it does not catch specific exceptions, such as SocketTimeoutException or TimeoutException. This means that if the restTemplate.getForEntity() method times out, the getRDSUserData() method will throw a HttpClientErrorException with the status code HttpStatus.INTERNAL_SERVER_ERROR, even though the error is not related to the HTTP client.
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.
As user is interacting with skill tree backend, if there is an error in calling any 3rd party service (RDS backend), I think from user POV its internal server error right?
@iamitprakash
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.
check the timeout value
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.
Here the socket exception, might not happen timeout can happen, try adding the timeout to the website backend call, to avoid waiting for the backend for long times