forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address leaks in fileserver caused by git backends
At this time we do not have the ability to fix the upstream memory leaks in the gitfs backend providers. Work around their limitations by periodically restarting the file server update proccess. This will at least partially address saltstack#50313
- Loading branch information
Showing
4 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Periodically restart the fileserver update process to avoid leaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import time | ||
|
||
import pytest | ||
import salt.master | ||
from tests.support.mock import patch | ||
|
||
|
||
def test_fileserver_duration(): | ||
with patch("salt.master.FileserverUpdate._do_update") as update: | ||
start = time.time() | ||
salt.master.FileserverUpdate.update(1, {}, 1) | ||
end = time.time() | ||
# Interval is equal to timeout so the _do_update method will be called | ||
# one time. | ||
update.called_once() | ||
# Timeout is 1 second | ||
assert 2 > end - start > 1 |