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

deprecate Tink worker global timeout cli flag: #605

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

jacobweinstock
Copy link
Member

Description

The Tink worker global timeout cli flag doesn't implement the global timeout defined in a Tink server template correctly.

A single template can have multiple workers. So a single Tink worker defining a global timeout for all tasks is erroneous. It doesn't take the multiple workers idea into account.

A long term solution will need to be implemented. Something that takes into account multiple workers. This PR just removes this erroneous behavior.

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock jacobweinstock added the kind/bug Categorizes issue or PR as related to a bug. label Apr 11, 2022
@jacobweinstock jacobweinstock requested a review from mmlb April 11, 2022 20:52
@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #605 (9382cd8) into main (08a2e12) will increase coverage by 0.25%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
+ Coverage   45.96%   46.22%   +0.25%     
==========================================
  Files          56       56              
  Lines        3283     3310      +27     
==========================================
+ Hits         1509     1530      +21     
- Misses       1684     1690       +6     
  Partials       90       90              
Impacted Files Coverage Δ
pkg/apis/core/v1alpha1/workflow_methods.go 76.27% <0.00%> (+1.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08a2e12...9382cd8. Read the comment docs.

var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, timeOut)
defer cancel()
logger.Info("timeOut is deprecated")
Copy link
Contributor

Choose a reason for hiding this comment

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

lets just get rid of the code, we have enough workarounds/deprecated things and it just turns into baggage. We're still at v <1.0 and also have sandbox to provide a cushion for breakages.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure thing

Copy link
Contributor

@micahhausler micahhausler left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Just one minor change

Comment on lines 89 to 90
ctx := context.Background()
err = w.ProcessWorkflowActions(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use the command context here?

Suggested change
ctx := context.Background()
err = w.ProcessWorkflowActions(ctx)
err = w.ProcessWorkflowActions(cmd.Context())

Copy link
Contributor

Choose a reason for hiding this comment

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

This is currently effectively the same thing. Will change if we do ExecuteContext in cmd/tink-worker/main.go which I think would give us ctrl-c support? For a later PR though.

The Tink worker global timeout cli flag doesn't implement
the global timeout defined in a Tink server template correctly.

A single template can have multiple workers. So a single
Tink worker defining a global timeout for all task is
erroneous. It doesn't take the multiple workers idea into account.

A long term solution will need to be implemented. Something that
takes into account multiple workers.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
Copy link
Contributor

@micahhausler micahhausler left a comment

Choose a reason for hiding this comment

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

LGTM

@mmlb mmlb added the ready-to-merge Signal to Mergify to merge the PR. label Apr 13, 2022
@mergify mergify bot merged commit 453f0fd into tinkerbell:main Apr 13, 2022
@jacobweinstock jacobweinstock deleted the tink-worker-timeout branch April 13, 2022 16:49
@displague displague added this to the 0.7.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants