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 provision_observer2 to delete failing Jobs correctly #114

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

ushitora-anqou
Copy link
Contributor

@ushitora-anqou ushitora-anqou commented Mar 29, 2024

The new provision observer (provision_observer2.go) introduced in #101 tries to remove the owned jobs that are failing for a while, but it doesn't work well because it looks for them by a wrong prefix.

This PR fixes the above problem by using constants.MountProbeNamePrefix and constants.ProvisionProbeNamePrefix instead of constants.ProbeNamePrefix when the provision observer looks for the failing jobs.

@ushitora-anqou
Copy link
Contributor Author

ushitora-anqou commented Apr 1, 2024

Waiting #115 to be merged. merged.

@ushitora-anqou ushitora-anqou marked this pull request as ready for review April 1, 2024 06:20
cupnes
cupnes previously approved these changes Apr 1, 2024
@@ -218,6 +218,18 @@ var _ = Describe("PieProbe resource", func() {
}
}
}).Should(Succeed())

// Check that failing Jobs are correctly removed.
Eventually(func(g Gomega) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I consider this test is unstable. I guess the failed jobs can be removed before this Eventually section starts.

How about checking only the deletion of the failed jobs? I mean, it might be good to remove the first Eventually section.

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 agree with you. I updated my patch. The changes are: https://github.com/topolvm/pie/compare/81787eaa12e9bf8ade9d452c4d58ed026af3ec7a..b8496f03e5f5c70a5a03ff72476f85669e1652e7

the failed jobs can be removed before this Eventually section starts.

Actually, even in this situation, the test should pass because the cronjob will create another job, while it can take a long time. I wrote the first Eventually to make the test fail when no jobs are created during the whole run for some reason. But this situation cannot happen because we already check the metrics (on_time=false) for dummy-sc. So, I believe the first Eventually is essentially meaningless.

The new provision observer (provision_observer2.go) introduced in #101 tries to
remove the owned jobs that is failing for a while, but it doesn't work well
because it looks for them by a wrong prefix.

This PR fixes the above problem by using constants.MountProbeNamePrefix and
constants.ProvisionProbeNamePrefix instead of constants.ProbeNamePrefix when
the provision observer looks for the jobs.

Signed-off-by: Ryotaro Banno <ryotaro.banno@gmail.com>
@peng225 peng225 merged commit 1bb1952 into main Apr 2, 2024
6 checks passed
@peng225 peng225 deleted the fix-periodic-job-deletion branch April 2, 2024 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants