Skip to content

Revert the Forget call that was happening on every Certificates and Orders sync - #4271

Merged
jetstack-bot merged 1 commit into
cert-manager:masterfrom
maelvls:forget-scheduler-item-deletedfunc
Jul 29, 2021
Merged

jetstack-bot merged 1 commit into
cert-manager:masterfrom
maelvls:forget-scheduler-item-deletedfunc

Conversation

@maelvls

@maelvls maelvls commented Jul 28, 2021 •

Copy link
Copy Markdown
Member

As pointed out by @munnerz, we feel not very confident in back-porting #4233 knowing that Forget is called on all three event types (Deleted, Updated, Added). We had a discussion about that with @irbekrm. I changed this in f03d48f, where the only event on why we run Forget is Deleted.

Why are we reverting 641960b?

After tonight's biweekly dev meeting, @wallrj asked the team why we would not accept backporting the Forget fix (641960b) in 1.4.2 and 1.3.2 but still accept it in 1.5.

The team agrees on the fact that it needs more testing (since it is not tested at all). I thus suggest we revert the untested Forget change that was merged.

The "Forget" memory leak that we are reverting now is the cause of a tiny fraction of the overall memory leakage that was fixed in the PR in the scheduler itself. Reverting this means that some goroutines will be leaked, but only when a Certificate gets removed and never recreated with the same name.

Which commit should still be backported to 1.4.2 and 1.3.2?

Only 2 out of the 3 commits of #4233 should be backported in that order:

  1. eb947f9
  2. 8e87263

/release-note-none
/kind cleanup

@jetstack-bot jetstack-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. area/acme Indicates a PR directly modifies the ACME Issuer code do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 28, 2021
@maelvls

maelvls commented Jul 28, 2021

Copy link
Copy Markdown
Member Author

After tonight's biweekly dev meeting, @wallrj asked the team why we would not accept the Forget fix in 1.4, but still accept it in 1.5? Bottom line, the team agrees on the fact that it needs to be tested, e.g. using some hidden/internal flag that would allow us to have certificates renewed after 1 minute.

I thus suggest we revert the untested Forget change that was merged.

@maelvls
maelvls force-pushed the forget-scheduler-item-deletedfunc branch from f03d48f to eed2e00 Compare July 28, 2021 17:16
@maelvls maelvls changed the title ScheduledWorkQueue.Forget now only run on deletion of Certificates and Orders Revert the Forget call that was happening on every Certificates and Orders sync Jul 28, 2021
@maelvls
maelvls force-pushed the forget-scheduler-item-deletedfunc branch 2 times, most recently from cea2cb8 to 0864a58 Compare July 28, 2021 17:18
This reverts commit 641960b. The reason we decided to revert this is
that we are unsure about the implications of adding the
scheduledWorkQueue.Forget call. The new Forget call is left untested,
and it makes us nervous not to know exactly if it works as intended.

The "Forget" memory leak that we are reverting now is the cause of a
tiny fraction of the overall memory leakage that was fixed in the PR
in the scheduler itself.  Reverting this means that some goroutines will
be leaked, but only when a Certificate gets removed and never recreated
with the same name.

Signed-off-by: Maël Valais <[email protected]>
Comment on lines +26 to +27
// We are writting our own time.AfterFunc to be able to mock the clock. The
// cancel function can be called concurrently.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// We are writting our own time.AfterFunc to be able to mock the clock. The
// cancel function can be called concurrently.
// We are writing our own time.AfterFunc to be able to mock the clock. The
// cancel function can be called concurrently.

How come this function moved?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Has it also changed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR is just the result of:

git revert 641960b666e94b8f592652f14f7b1fc313c7e97b

(I checked it was the same)

The original commit moved the function, so the revert moves it back.

@SgtCoDFish SgtCoDFish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

Confirmed this is the result of git revert 641960b666e94b8f592652f14f7b1fc313c7e97b

It'd be nice to not re-add the spelling mistake in the comment, but I think it's valuable to make the revert the inverse of the original commit; it makes it simpler to reason about I think.

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2021
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maelvls, SgtCoDFish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@SgtCoDFish SgtCoDFish added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 29, 2021
@SgtCoDFish

Copy link
Copy Markdown
Member

/test pull-cert-manager-bazel

@jetstack-bot
jetstack-bot merged commit 6d13f91 into cert-manager:master Jul 29, 2021
@jetstack-bot jetstack-bot added this to the v1.5 milestone Jul 29, 2021
@maelvls
maelvls deleted the forget-scheduler-item-deletedfunc branch July 29, 2021 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/acme Indicates a PR directly modifies the ACME Issuer code dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants