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

Support force clean finalizer in various chaos types #478

Merged
merged 6 commits into from
May 13, 2020

Conversation

yujunz
Copy link
Contributor

@yujunz yujunz commented May 9, 2020

What problem does this PR solve?

#227

What is changed and how does it work?

Force clean finalizer

Check List

Tests

  • Manual test (see examples/clean-finalizer)

Code changes

  • Has Go code change

Does this PR introduce a user-facing change?:

Add support to force clean finalizer with annotation in various chaos types

@yujunz yujunz changed the title Support force clean finalizer in networkchaos/tbf Support force clean finalizer in networkchaos May 9, 2020
@yujunz
Copy link
Contributor Author

yujunz commented May 9, 2020

@cwen0 It is almost a copy & paste from #415 .

Would it be good to refactor networkchaos types to reduce code duplicate?

@yujunz
Copy link
Contributor Author

yujunz commented May 9, 2020

It seems not just networkchaos, some other types of chaos also have similar boilerplate code.

@yujunz yujunz changed the title Support force clean finalizer in networkchaos Support force clean finalizer in various chaos types May 9, 2020
@yujunz yujunz marked this pull request as ready for review May 9, 2020 01:35
@yujunz
Copy link
Contributor Author

yujunz commented May 9, 2020

The test failure seems irrelevant to this PR.

• Failure [0.012 seconds]
PTrace
/home/runner/work/chaos-mesh/chaos-mesh/go/src/github.com/pingcap/chaos-mesh/pkg/ptrace/ptrace_linux_test.go:63
  should mmap slice successfully [It]
  /home/runner/work/chaos-mesh/chaos-mesh/go/src/github.com/pingcap/chaos-mesh/pkg/ptrace/ptrace_linux_test.go:88
  error: no such process

Is it just flake? How to re-trigger test?

@yeya24
Copy link
Contributor

yeya24 commented May 9, 2020

The test failure seems irrelevant to this PR.

• Failure [0.012 seconds]
PTrace
/home/runner/work/chaos-mesh/chaos-mesh/go/src/github.com/pingcap/chaos-mesh/pkg/ptrace/ptrace_linux_test.go:63
  should mmap slice successfully [It]
  /home/runner/work/chaos-mesh/chaos-mesh/go/src/github.com/pingcap/chaos-mesh/pkg/ptrace/ptrace_linux_test.go:88
  error: no such process

Is it just flake? How to re-trigger test?

Yes, it is flaky and I saw this several times. I will re-trigger the CI for you.

@cwen0
Copy link
Member

cwen0 commented May 11, 2020

/run-e2e-test

@cwen0
Copy link
Member

cwen0 commented May 11, 2020

It seems not just networkchaos, some other types of chaos also have similar boilerplate code.

@yujunz Yes, at present, we have some repeated code in deferent chaos, we also want to refine these code, do you have any good idea about this issue?

@yujunz
Copy link
Contributor Author

yujunz commented May 11, 2020

@yujunz Yes, at present, we have some repeated code in deferent chaos, we also want to refine these code, do you have any good idea about this issue?

We may need an abstract layer for it. There are already something like InnerReconciler, TwoPhaseReconciler but I haven't look into the details. Generally speaking, we may move some common logic to the abstract layer or have some factory method to create those common logic when initializing the concrete chaos object.

My two cents.

@cwen0
Copy link
Member

cwen0 commented May 11, 2020

@yujunz Yes, at present, we have some repeated code in deferent chaos, we also want to refine these code, do you have any good idea about this issue?

We may need an abstract layer for it. There are already something like InnerReconciler, TwoPhaseReconciler but I haven't look into the details. Generally speaking, we may move some common logic to the abstract layer or have some factory method to create those common logic when initializing the concrete chaos object.

My two cents.

I agree with your idea. But we won't include it in the next release and implement it in the later versions. Because this modification needs to involve a lot of places and work to do. If you are interested in it, you can push a proposal and help us to improve this. 😁

controllers/kernelchaos/types.go Outdated Show resolved Hide resolved
controllers/networkchaos/partition/types.go Outdated Show resolved Hide resolved
@yujunz
Copy link
Contributor Author

yujunz commented May 11, 2020

Re-grouped imports. @cwen0

@yujunz
Copy link
Contributor Author

yujunz commented May 11, 2020

The same flake...

@yeya24
Copy link
Contributor

yeya24 commented May 11, 2020

/run-e2e-test

controllers/networkchaos/tbf/types.go Show resolved Hide resolved
controllers/kernelchaos/types.go Outdated Show resolved Hide resolved
controllers/networkchaos/partition/types.go Outdated Show resolved Hide resolved
controllers/networkchaos/tbf/types.go Outdated Show resolved Hide resolved
controllers/podchaos/podfailure/types.go Outdated Show resolved Hide resolved
controllers/stresschaos/types.go Outdated Show resolved Hide resolved
controllers/timechaos/types.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM if E2E passed

@yeya24
Copy link
Contributor

yeya24 commented May 12, 2020

/run-e2e-test

1 similar comment
@cwen0
Copy link
Member

cwen0 commented May 13, 2020

/run-e2e-test

Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM

@cwen0
Copy link
Member

cwen0 commented May 13, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

Your auto merge job has been accepted, waiting for:

  • 481

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

/run-all-tests

@codecov-io
Copy link

codecov-io commented May 13, 2020

Codecov Report

Merging #478 into master will increase coverage by 0.13%.
The diff coverage is 52.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #478      +/-   ##
==========================================
+ Coverage   58.57%   58.71%   +0.13%     
==========================================
  Files          60       68       +8     
  Lines        3626     4374     +748     
==========================================
+ Hits         2124     2568     +444     
- Misses       1333     1616     +283     
- Partials      169      190      +21     
Impacted Files Coverage Δ
api/v1alpha1/common_webhook.go 100.00% <ø> (ø)
api/v1alpha1/iochaos_types.go 31.11% <0.00%> (-1.45%) ⬇️
api/v1alpha1/kernelchaos_types.go 4.44% <0.00%> (-0.21%) ⬇️
api/v1alpha1/networkchaos_types.go 18.65% <0.00%> (-0.29%) ⬇️
api/v1alpha1/podchaos_types.go 31.11% <0.00%> (-1.45%) ⬇️
controllers/podchaos/types.go 65.95% <0.00%> (ø)
controllers/stresschaos_controller.go 0.00% <0.00%> (ø)
controllers/timechaos_controller.go 0.00% <0.00%> (ø)
controllers/twophase/types.go 55.78% <0.00%> (-7.31%) ⬇️
pkg/chaosdaemon/netem_linux.go 26.66% <0.00%> (-17.78%) ⬇️
... and 38 more

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 2dbab6c...2d78dba. Read the comment docs.

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

@yujunz merge failed.

@cwen0
Copy link
Member

cwen0 commented May 13, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

Your auto merge job has been accepted, waiting for:

  • 466

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

@yujunz merge failed.

@cwen0 cwen0 merged commit 18c13f3 into chaos-mesh:master May 13, 2020
@yujunz
Copy link
Contributor Author

yujunz commented May 13, 2020

What is the cause of "merge failed" ? @cwen0

@yujunz yujunz deleted the clean-finalizer branch May 13, 2020 06:26
@you06
Copy link
Member

you06 commented May 13, 2020

@yujunz it's caused by a bug of sre-bot 🤖. FYI pingcap-incubator/cherry-bot/22.

sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
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.

6 participants