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
PostgresNode::_release_resource is added
This private method releases all the allocated node resources (port and so on).

PostgresNode::__exit__ calls this new method instead free_port.
  • Loading branch information
dmitry-lipetsk committed May 4, 2025
commit 10ebf18f0c60b9e88db0d99e3823993045420adf
5 changes: 4 additions & 1 deletion testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def __exit__(self, type, value, traceback):
else:
self._try_shutdown(attempts)

self.free_port()
self._release_resources()

def __repr__(self):
return "{}(name='{}', port={}, base_dir='{}')".format(
Expand Down Expand Up @@ -663,6 +663,9 @@ def _try_shutdown(self, max_attempts, with_force=False):
ps_output,
ps_command)

def _release_resources(self):
self.free_port()

@staticmethod
def _throw_bugcheck__unexpected_result_of_ps(result, cmd):
assert type(result) == str # noqa: E721
Expand Down