Skip to content

Conversation

@omerap12
Copy link
Member

Ⅰ. Describe what this PR does

Adds a context timeout mechanism to all controllers' Reconcile functions.

Ⅱ. Does this pull request fix one issue?

fixes #1144

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

  1. Timeout Value: Please verify that the 10-minute timeout duration is appropriate for the reconciliation process.
  2. Logging Suggestion: Consider adding logs to the reconcile function that include the timeout value for better traceability.

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Aug 10, 2024

Hi @omerap12. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cheyang cheyang requested a review from TrafalgarZZZ August 11, 2024 03:41
Copy link
Member

@TrafalgarZZZ TrafalgarZZZ left a comment

Choose a reason for hiding this comment

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

Sorry for my late reply. Thanks for making this and I have just one comment for the PR: Moving limited context.Context to func ReconcileInternal() looks better to me, because most reconciliation logic resides in it and all the runtime controllers reuse the function.


// reconcile the implement
return r.ReconcileInternal(ctx)
return r.ReconcileInternal(reconcileCtx)
Copy link
Member

@TrafalgarZZZ TrafalgarZZZ Aug 22, 2024

Choose a reason for hiding this comment

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

How about moving ctxWithTimeout, cancel := context.WithTimeout(ctx, reconcileTimeout) to func RuntimeReconciler.ReconcileInternal()? The changes now are only applied to AlluxioRuntime. Moving to func RuntimeReconciler.ReconcileInternal() can apply limited context.Context to all the Runtimes (e.g. JindoRuntime, JuiceFSRuntime, etc.) defined in Fluid.

@omerap12
Copy link
Member Author

Hey @TrafalgarZZZ , thanks for your review. Sure I'll adjust the code.
one question, do all runtimes should have the same limited amount of time?

@TrafalgarZZZ
Copy link
Member

Hey @TrafalgarZZZ , thanks for your review. Sure I'll adjust the code. one question, do all runtimes should have the same limited amount of time?

@omerap12 I think 10-minute timeout duration is pretty enough for all the runtimes, so it's okay for all runtimes to have the same limited amount of time.

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
@sonarqubecloud
Copy link

Copy link
Member

@TrafalgarZZZ TrafalgarZZZ left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Aug 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TrafalgarZZZ

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

@TrafalgarZZZ TrafalgarZZZ merged commit b2629fe into fluid-cloudnative:master Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURES] bind all reconcile loops with limited context.Context

2 participants