Skip to content

[19.03 backport] Fix leaking tasks.db#2940

Merged
dperny merged 1 commit intomoby:bump_v19.03from
thaJeztah:19.03_backport_fix_leaking_task_db
Apr 3, 2020
Merged

[19.03 backport] Fix leaking tasks.db#2940
dperny merged 1 commit intomoby:bump_v19.03from
thaJeztah:19.03_backport_fix_leaking_task_db

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

backport of #2938

For a long time, it's been a known fault that tasks.db grows out of
control. The reason is that this database is only cleaned up, and old
tasks removed, during initialization.

When an assignment to a worker is removed, previously, the assignment
was just marked as removed in the tasks database. However, an assignment
is only removed from a worker when the task is removed from the manager.
The worker does not need to continue to keep track of the task.

Instead of marking a task as no longer assigned, when a task is removed
as an assignment, we'll simply delete it from the database.

I'm not 100% sure of what all the task database is responsible for, or
why it needs to be persisted, so this change is targeted to have the
minimal impact on the system.

Signed-off-by: Drew Erny derny@mirantis.com
(cherry picked from commit 585521d)
Signed-off-by: Sebastiaan van Stijn github@gone.nl

- What I did

- How I did it

- How to test it

- Description for the changelog

For a long time, it's been a known fault that tasks.db grows out of
control. The reason is that this database is only cleaned up, and old
tasks removed, during initialization.

When an assignment to a worker is removed, previously, the assignment
was just marked as removed in the tasks database. However, an assignment
is only removed from a worker when the task is removed from the manager.
The worker does not need to continue to keep track of the task.

Instead of marking a task as no longer assigned, when a task is removed
as an assignment, we'll simply delete it from the database.

I'm not 100% sure of what all the task database is responsible for, or
why it needs to be persisted, so this change is targeted to have the
minimal impact on the system.

Signed-off-by: Drew Erny <derny@mirantis.com>
(cherry picked from commit 585521d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

@dperny @SamWhited @cpuguy83 ptal

@dperny dperny merged commit 0b8364e into moby:bump_v19.03 Apr 3, 2020
@dperny
Copy link
Copy Markdown
Collaborator

dperny commented Apr 3, 2020

@thaJeztah merged.

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.

2 participants