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

SUMO-115364 Handle exceptions thrwon from kubeclient calls #106

Merged
merged 4 commits into from Jul 31, 2019

Conversation

yuting-liu
Copy link
Contributor

@yuting-liu yuting-liu commented Jul 30, 2019

Since we are using timer_execute for start_monitor, any exceptions thrown from the method will cause the timer detached.

We are going to add exceptions handling for all methods that have kubeclient calls in events plugin, including following methods:

start_watcher_thread
create_config_map
patch_config_map
initialize_resource_version
pull_resource_version

We will only rescue possible errors and then log the error so that we can know errors from which method they throw. For all other methods except for start_watch_thread, we don't want errors from kubeclient blocks the thread of watching, so we just log the error and ignore it. For start_watcher_thread, we need timer_execute continues working so exceptions will be swallowed and timer won't be detached in this case.

maimaisie
maimaisie previously approved these changes Jul 30, 2019
Copy link
Contributor

@maimaisie maimaisie left a comment

Choose a reason for hiding this comment

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

LGTM with some comments in the unit tests

fluent-plugin-events/test/plugin/test_in_events.rb Outdated Show resolved Hide resolved
fluent-plugin-events/test/plugin/test_in_events.rb Outdated Show resolved Hide resolved
samjsong
samjsong previously approved these changes Jul 31, 2019
Copy link
Contributor

@samjsong samjsong left a comment

Choose a reason for hiding this comment

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

LGTM pending Maisie's comments

@yuting-liu yuting-liu dismissed stale reviews from samjsong and maimaisie via 00aea2d July 31, 2019 20:20
@yuting-liu
Copy link
Contributor Author

Refactored the part of creating the test driver with configuration and instance variable setup into a method configure_test_driver(config = %([])).

Copy link
Contributor

@maimaisie maimaisie left a comment

Choose a reason for hiding this comment

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

LGTM

@yuting-liu yuting-liu merged commit 1da2d74 into master Jul 31, 2019
@yuting-liu yuting-liu deleted the yuting-exception branch July 31, 2019 21:02
psaia pushed a commit to psaia/sumologic-kubernetes-collection that referenced this pull request May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants