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 pod template envvars #372

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Fix pod template envvars #372

merged 2 commits into from
Jan 15, 2024

Conversation

adwk67
Copy link
Member

@adwk67 adwk67 commented Jan 12, 2024

Description

See #371.
The envOverrides entries are added to the config-map for the kubernetesExecutor pod template by iterating over a HashMap: this leads to a unpredictable order and unnecessary restarts of airflow components. The HashMap is converted to a BTreeMap to avoid this happening.

🟢 https://ci.stackable.tech/view/02%20Operator%20Tests%20(custom)/job/airflow-operator-it-custom/121/

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Preview Give feedback

Reviewer

Preview Give feedback

Acceptance

Preview Give feedback

@adwk67 adwk67 changed the title fix pod template envvars Fix pod template envvars Jan 12, 2024
@adwk67 adwk67 self-assigned this Jan 12, 2024
@adwk67 adwk67 marked this pull request as ready for review January 13, 2024 10:33
@lfrancke
Copy link
Member

I'm curious: Can you explain why the unpredictable ordering causes restarts? I'm not sure I understand yet.

Also: Would this affect other operators as well?

@lfrancke
Copy link
Member

Also: Good find!

@adwk67
Copy link
Member Author

adwk67 commented Jan 13, 2024

Before this change the configMap gets written up to three times (same UID but different resource versions) - to be honest, I'm not sure why - and the ordering was not consistent. But it's one of the few cases where we write env-vars to the config map as it is for the executor template. As airflow (and superset) both have restarts annotated this causes the phenomenon: we should probably change this for common_config.env-overrides so that any callout gets an ordered map. Props go to @nightkr, who suggested the HashMap could be the cause!

Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

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

Nice, and I appreciate the PR description :)

@adwk67 adwk67 added this pull request to the merge queue Jan 15, 2024
Merged via the queue into main with commit 2602dff Jan 15, 2024
29 checks passed
@adwk67 adwk67 deleted the fix/pod-template-ordered-envvars branch January 15, 2024 09:05
@soenkeliebau
Copy link
Member

awesome find Andrew, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants