Skip to content

Conversation

@mayankrai09
Copy link
Member

@mayankrai09 mayankrai09 commented Jul 13, 2023

feat: Added exclusion range with fail_on_errors for HTTP post-processors
GTF side we have some use cases where we must ignore some of the HTTP response codes when fail_on_errors is true.

@mayankrai09 mayankrai09 marked this pull request as ready for review July 30, 2023 18:28
return !getExcludeFailOnErrorCodes(httpSourceConfig.getExcludeFailOnErrorsCodeRange()).contains(statusCode);
}

private HashSet<Integer> getExcludeFailOnErrorCodes(String input) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should save the list of error codes and not generate for every response. the list can be created and saved outside of the Response Handler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, made changes

postResponseTelemetry.validateResponseCode(meterStatsManager, statusCode);
failureHandler("Received status code : " + statusCode);
boolean shouldFailOnError = (httpSourceConfig.isFailOnErrors() ? shouldFailOnError(statusCode) : false);
failureHandler("Received status code : " + statusCode, shouldFailOnError);
Copy link
Member

@lavkesh lavkesh Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest to keep the method signature same.
and in line 131 do

if(shouldFailOnError(statusCode)) {
...
}

then the method sholdFailOnError will do the necessary checks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made changes

Copy link
Member

@lavkesh lavkesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the comments

@mayankrai09 mayankrai09 requested a review from lavkesh August 9, 2023 12:26
@lavkesh lavkesh merged commit 11fc8e1 into main Aug 16, 2023
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.

3 participants