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] Handle kill nicely #17318

Merged
merged 7 commits into from
Apr 14, 2020

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Mar 30, 2020

What does this PR do?

Changes to some context handles.

TBH i dont like this solution, and i think we will need to udnertake some more complex refactor to behave nicer, we have a lot of moving parts and background workers which are interconnected what makes this a bit complicated to introduce context as a second step (we started completely without context)

I'm ok to get this in as a quick fix but under a condition of further refactor, so i'm publishing this as a draft.

Why is it important?

To speed up ctrl c kill

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Project:fleet)

@michalpristas michalpristas changed the title mode context [Agent] Handle kill nicely Mar 30, 2020
@michalpristas michalpristas self-assigned this Mar 30, 2020
@michalpristas michalpristas marked this pull request as ready for review April 3, 2020 07:33
Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

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

LGTM, just remove the Println and lets get the CI in to be safe.

@@ -155,7 +156,8 @@ func (f *fleetGateway) worker() {

func (f *fleetGateway) doExecute() (*fleetapi.CheckinResponse, error) {
f.backoff.Reset()
for {
for f.bgContext.Err() == nil {
fmt.Println(">>> loop: ", f.bgContext.Err())
Copy link
Contributor

Choose a reason for hiding this comment

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

debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh :D

@ph ph added the needs_backport PR is waiting to be backported to other branches. label Apr 3, 2020
@michalpristas michalpristas merged commit 65b5255 into elastic:master Apr 14, 2020
michalpristas added a commit to michalpristas/beats that referenced this pull request Apr 15, 2020
[Agent] Improved cancellation of agent (elastic#17318)

(cherry picked from commit 65b5255)
michalpristas added a commit that referenced this pull request Apr 15, 2020
[Agent] Improved cancellation of agent (#17318)

(cherry picked from commit 65b5255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_backport PR is waiting to be backported to other branches.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants