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
Next Next commit
[FIX] PostgresNode.__exit__ releases port after shutdown and cleanup
We must release a port number after the shutdown and cleanup operation not before.

It is a part of work for #249
  • Loading branch information
dmitry-lipetsk committed May 4, 2025
commit 18699f684c19feab64689ebae4e1b4bd4095a69c
4 changes: 2 additions & 2 deletions testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ def __enter__(self):
return self

def __exit__(self, type, value, traceback):
self.free_port()

# NOTE: Ctrl+C does not count!
got_exception = type is not None and type != KeyboardInterrupt

Expand All @@ -246,6 +244,8 @@ def __exit__(self, type, value, traceback):
else:
self._try_shutdown(attempts)

self.free_port()

def __repr__(self):
return "{}(name='{}', port={}, base_dir='{}')".format(
self.__class__.__name__,
Expand Down