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

disconnected clients: Add reconnect task event #12133

Conversation

DerekStrickland
Copy link
Contributor

@DerekStrickland DerekStrickland commented Feb 25, 2022

This PR introduces a new TaskClientReconnected task event. This task event will be appended by the allocRunner each time an unknown alloc is reconnected after the client comes back online.

This PR includes:

  • The changes related to defining the TaskEvent and translating it to meaningful human text for display.
  • Refactors the reconnect logic out of the client and into the allocRunner as it has grown in scope. Specifically, the logic workflow is now:
    • Appends a task event entry for allocs still running on the client.
    • Updates the existing alloc instance with the indexes from the incoming update.
    • Recomputes task states with new events.
    • Calls clientAlloc to compute the current alloc state including the appended events.
    • Updates the client state store with the updated alloc. Exits if this fails.
    • Propagates the client alloc state to the server.
    • Broadcasts the alloc update to all listeners.
    • Removes reconnects from the Plan as they will be pulled by the node when it reconnects.

client/allocrunner/alloc_runner.go Outdated Show resolved Hide resolved
client/client.go Show resolved Hide resolved
client/allocrunner/alloc_runner_test.go Outdated Show resolved Hide resolved
@hashicorp hashicorp deleted a comment from motobrowning Mar 1, 2022
Copy link
Contributor Author

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

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

Follow up question in thread

client/allocrunner/alloc_runner.go Show resolved Hide resolved
client/client.go Outdated Show resolved Hide resolved
Log as error not trace
@vercel vercel bot temporarily deployed to Preview – nomad March 1, 2022 19:31 Inactive
@DerekStrickland DerekStrickland merged commit 91f70a6 into f-disconnected-client-allocation-handling Mar 2, 2022
@DerekStrickland DerekStrickland deleted the f-task-event-disconnected-clients branch March 2, 2022 10:47
DerekStrickland added a commit that referenced this pull request Apr 5, 2022
* Add TaskClientReconnectedEvent constant
* Add allocRunner.Reconnect function to manage task state manually
* Removes server-side push
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants