Skip to content

Conversation

joestringer
Copy link
Member

@joestringer joestringer commented Mar 19, 2020

Once this PR is merged, you can update the PR labels via:

$ for pr in 10630; do contrib/backporting/set-labels.py $pr done 1.6; done

[ upstream commit 83cad91 ]

Semantically these are similar, but the new name is less specific to
compilation, allowing an upcoming patch to also switch on whether to
reuse existing state dir files based upon whether the headerfiles were
regenerated.

No functional changes in this patch.

Signed-off-by: Joe Stringer <joe@cilium.io>
[ upstream commit dbec3fd ]

[ Backporter's notes: Minor fixes necessary for additional error
  cases on the older branch. Treat those error cases as not changing
  the headerfiles on the filesystem. ]

In certain circumstances, it was possible for the endpoint lxc_config.h
headerfile to disappear if the endpoint was regenerated twice. In some
circumstances this could be mitigated by the presence of FQDN policy
which would recreate the file, but if the daemon was killed promptly
before the endpoint controller for storing FQDN state runs, or if the
user manually regenerates the endpoint multiple times, then the file
could be missing.

If you combine this with an agent restart, this may cause Cilium to
forget about managing an endpoint which it previously managed,
potentially leading later to connectivity issues when Cilium fails to
push policy entries for this endpoint to allow traffic to flow.

This patch fixes the issue by ensuring that if the headerfile is not
recreated during the regeneration process, the old one is moved on the
filesystem from the existing path into the new state dir path.

Fixes: 6778d02 ("endpoint: Only rewrite headerfile when ep changes")
Fixes: #10337
Fixes: #10603

Signed-off-by: Joe Stringer <joe@cilium.io>
@joestringer joestringer requested a review from a team as a code owner March 19, 2020 19:35
@joestringer joestringer added backport/1.6 kind/backports This PR provides functionality previously merged into master. labels Mar 19, 2020
@joestringer joestringer changed the title v1.6 backports 2020-03-19 [1.6] Fix issue where lxc_config.h header disappears after some regenerations Mar 19, 2020
@joestringer
Copy link
Member Author

never-tell-me-the-odds

@aanm aanm merged commit 27431e7 into v1.6 Mar 20, 2020
@aanm aanm deleted the pr/v1.6-backport-10630 branch March 20, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backports This PR provides functionality previously merged into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants