Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[#249] Fix of port number leak in NodeBackup::spawn_replica #250

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

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
The new argument 'release_resources' of PostgresNode::cleanup method …
…is added

When this argument is True, cleanup calls _release_resources method.

Default value is False.
  • Loading branch information
dmitry-lipetsk committed May 4, 2025
commit 102289bc7292d8bca6ded4fe430acce4fdd2cfca
5 changes: 4 additions & 1 deletion testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ def free_port(self):
self._port = None
self._port_manager.release_port(port)

def cleanup(self, max_attempts=3, full=False):
def cleanup(self, max_attempts=3, full=False, release_resources=False):
"""
Stop node if needed and remove its data/logs directory.
NOTE: take a look at TestgresConfig.node_cleanup_full.
Expand All @@ -1366,6 +1366,9 @@ def cleanup(self, max_attempts=3, full=False):

self.os_ops.rmdirs(rm_dir, ignore_errors=False)

if release_resources:
self._release_resources()

return self

@method_decorator(positional_args_hack(['dbname', 'query']))
Expand Down