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

Add exception handler to SharedInformerFactory #1992

Conversation

cbuschka
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2021
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 16, 2021
@cbuschka cbuschka closed this Nov 16, 2021
@cbuschka cbuschka reopened this Nov 16, 2021
@cbuschka
Copy link
Contributor Author

Relates to issue #1629

@cbuschka
Copy link
Contributor Author

/check-cla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 17, 2021
@brendandburns
Copy link
Contributor

This looks reasonable to me. Can you add unit tests to ensure we don't regress in the future?

Thanks!

@cbuschka
Copy link
Contributor Author

cbuschka commented Nov 17, 2021

@brendandburns Sorry for the confusion. Could you please link this pr to issue #1629. In #1629 (comment) I wanted to give @domainname the chance to confirm that this change will solve his problem. Sure it lacks reasonable default value handling, tests, and a little love ;) Will add it.

@brendandburns brendandburns linked an issue Nov 17, 2021 that may be closed by this pull request
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 17, 2021
@cbuschka cbuschka force-pushed the issue1629_extend_exception_handling_from_shared_informer_factory branch 2 times, most recently from 66aa670 to 86f9e10 Compare November 18, 2021 06:44
@cbuschka cbuschka force-pushed the issue1629_extend_exception_handling_from_shared_informer_factory branch from 86f9e10 to eb8e28b Compare November 18, 2021 06:46
@cbuschka cbuschka marked this pull request as ready for review November 18, 2021 07:07
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2021
@@ -65,19 +66,34 @@

private ScheduledFuture reflectorFuture;

/* visible for testing */ BiConsumer<Class<ApiType>, Throwable> exceptionHandler;

public Controller(
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 am not sure if these constructor chains are a good strategy long term. The best option I currently see is

  • add a builder for the class
  • use the all params constructor from the builder
  • deprecate all constructors with partial param sets

Also I would try to get rid of the many new calls here via factories. This could improve testability and introduce entry points for people who want to influence behaviour. A larger change but could be done in baby steps. What do you think @brendandburns ?

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 file this as an issue so we can have a broader discussion? I want to get @yue9944882 to weigh in as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yay, have created issue #1995 for discussion. Looking forward to if :)

@cbuschka
Copy link
Contributor Author

@brendandburns Now it is ready for review. Could you take a look into it, please. I have added some comments. But they are more kind of a discussion. Is there a place to discuss issues?

@brendandburns
Copy link
Contributor

This looks good to me, but would like @yue9944882 to look at the test refactor to make sure we didn't lose any coverage.

Copy link
Member

@yue9944882 yue9944882 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 24, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cbuschka, yue9944882

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0642e7b into kubernetes-client:master Nov 24, 2021
@cbuschka cbuschka deleted the issue1629_extend_exception_handling_from_shared_informer_factory branch November 24, 2021 06:40
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Difficult to extend exception handler
4 participants