Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from testgres.operations.local_ops import LocalOperations
from testgres.operations.remote_ops import RemoteOperations

__version__ = "1.15.1"
__version__ = "1.15.2"

__all__ = [
"get_new_node",
Expand Down
2 changes: 1 addition & 1 deletion src/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
assert type(log_file_encoding) is str
assert os_ops is None or isinstance(os_ops, OsOperations)

threading.Thread.__init__(self)
threading.Thread.__init__(self, daemon=True)

if os_ops is None:
os_ops = tconf.os_ops
Expand Down
18 changes: 13 additions & 5 deletions src/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ def _try_shutdown(self, max_attempts, with_force=False):
assert type(with_force) is bool
assert max_attempts > 0

try:
self._try_shutdown_internal(max_attempts, with_force)
finally:
self._maybe_stop_logger()

def _try_shutdown_internal(self, max_attempts, with_force):
attempts = 0

# try stopping server N times
Expand Down Expand Up @@ -1331,11 +1337,13 @@ def stop(self, params=[], wait=True):
"stop"
] + params # yapf: disable

execute_utility2(self._os_ops, _params, self.utils_log_file)

self._manually_started_pm_pid = None

self._maybe_stop_logger()
try:
execute_utility2(self._os_ops, _params, self.utils_log_file)
self._manually_started_pm_pid = None
finally:
# always stop the reader thread, even if pg_ctl stop failed,
# so it can't leak into interpreter shutdown.
self._maybe_stop_logger()
return self

def kill(self, someone=None):
Expand Down
Loading