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

agent: tolerate more failure scenarios during service registration with central config enabled #6472

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Sep 10, 2019

Also:

  • Finished threading replaceExistingChecks setting (from Add an option to register services and their checks idempotently #4905) through service manager.

  • Respected the original configSource value that was used to register a service or a check when restoring persisted data.

  • Run several existing tests with and without central config enabled (not exhaustive yet).

  • Switch to ioutil.ReadFile for all types of agent persistence.

Fixes #6323

@rboyer rboyer requested a review from a team September 10, 2019 19:48
@rboyer rboyer self-assigned this Sep 10, 2019
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Nice job.

This is a pretty big diff and took some refactoring of the service manager and agent plumbing.

I'd say I've not reviewed it super in depth. But I have looked through all the code and commented only on a few minor things.

The tests look good at a high level but I didn't carefully analyse whether they cover every possible case etc.

I'm happy to approve, is there anything you are concerned about that should get closer scrutiny or additional manual/integration testing?

agent/agent.go Outdated Show resolved Hide resolved

return out, nil
}

Copy link
Member

Choose a reason for hiding this comment

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

Thought: I realise this is following the existing pattern, but do you think it would be worth factoring this out into a separate file? This file being big doesn't cause too many practical issues for me so maybe not worth the effort now but I wonder if all the persistence stuff in here would be better as a separate package at some point or at least a separate file in this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can move it out into its own file.

Copy link
Member Author

Choose a reason for hiding this comment

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

agent/agent.go Show resolved Hide resolved
agent/service_manager.go Outdated Show resolved Hide resolved
@rboyer rboyer requested a review from banks September 23, 2019 22:27
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Thanks, that seems good RB!

// invoked to clear irrelevant fields.
//
// The ServiceManager.AddService signature is largely just a passthrough for
// addServiceLocked and should be treated as such.
Copy link
Member

Choose a reason for hiding this comment

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

🤔 my initial reaction to this was that is seems uglier than the massive argument lists it replaced and maybe the smell indicated that we should have just built this whole registration pipeline differently.

But after thinking some I'm not sure it's too bad and the alternatives don't seem obviously cleaner. I think it's OK as it is.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we start really using central service config more it might be worth the investment to rethink this whole Agent structure. It's not a quick fix.

…th central config enabled

Also:

* Finished threading replaceExistingChecks setting (from GH-4905)
  through service manager.

* Respected the original configSource value that was used to register a
  service or a check when restoring persisted data.

* Run several existing tests with and without central config enabled
  (not exhaustive yet).

* Switch to ioutil.ReadFile for all types of agent persistence.
@rboyer rboyer merged commit 5882e21 into master Sep 24, 2019
rboyer added a commit that referenced this pull request Sep 24, 2019
…th central config enabled (#6472)

Also:

* Finished threading replaceExistingChecks setting (from GH-4905)
  through service manager.

* Respected the original configSource value that was used to register a
  service or a check when restoring persisted data.

* Run several existing tests with and without central config enabled
  (not exhaustive yet).

* Switch to ioutil.ReadFile for all types of agent persistence.
@rboyer rboyer deleted the fix-central-config branch September 24, 2019 15:06
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.

central service config resolution can be disregarded in restart and failure conditions
2 participants