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

THREESCALE-7906 - initialization of $post_action_impact and $target_host variables as tables #1340

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

samugi
Copy link
Contributor

@samugi samugi commented May 4, 2022

As a follow up to #1319, 2 more variables require to be initialized with a default value to avoid generating "uninitialized variables" logs in case a large URI is passed in the request (that causes 414 Request-URI Too Large): $target_host and $post_action_impact

@samugi samugi requested a review from a team as a code owner May 4, 2022 11:51
@kevprice83 kevprice83 requested review from a team and removed request for a team May 4, 2022 13:05
Copy link
Member

@kevprice83 kevprice83 left a comment

Choose a reason for hiding this comment

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

Summary of fix as I understand this:

THREESCALE-7906 reported 2 uninitialised variables being referenced in the access_logs so #1319 was fixing that BUT in fact once those were fixed another 2 variables were causing the same problem but were not caught because of a lack of testing for this log warning. Adding a test to catch this warn statement will make future occurrences much easier to detect.

Fix and proper tests look good to me. Nice work @samugi 💪

@@ -14,6 +14,13 @@ map "" $extended_access_logs_enabled {
default '0';
}

map "" $post_action_impact {
default 0;
Copy link
Member

Choose a reason for hiding this comment

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

I think the value is defined as a string '0'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've set it to empty string to reflect this

@samugi samugi force-pushed the THREESCALE-7906_fix_missing_variables branch from ee556b6 to cff638e Compare May 4, 2022 16:06
@@ -14,6 +14,13 @@ map "" $extended_access_logs_enabled {
default '0';
}

map "" $post_action_impact {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't be removed from

set $post_action_impact '';
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently investigating this. Removing this line would make sense but it seems to require reviewing our non-blackbox tests (that don't use apicast.conf.liquid).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

non blackbox tests conversion to Blackbox tracked here: #1343

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@samugi samugi changed the title THREESCALE-7906 - added missing variables THREESCALE-7906 - initialization of $post_action_impact and $target_host variables as tables May 17, 2022
@samugi samugi force-pushed the THREESCALE-7906_fix_missing_variables branch from cff638e to 5d1e799 Compare June 7, 2022 10:02
@samugi samugi merged commit 88b7589 into master Jun 7, 2022
@samugi samugi deleted the THREESCALE-7906_fix_missing_variables branch June 7, 2022 10:30
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

3 participants