Skip to content

[Refactoring] Default port manager functions now use PortManager__Generic and LocalOperations #251

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

Conversation

dmitry-lipetsk
Copy link
Collaborator

@dmitry-lipetsk dmitry-lipetsk commented May 4, 2025

This patch deletes a duplication of port manager code.

Now utils.reserve_port and utils.release_port works through _old_port_manager - it is a global instance of PortManager__Generic that uses a global instance of LocalOperations.

It means that PortManager__ThisHost works through instance of PortManager__Generic.

Additional changes

  • MT-problem with creation of PortManager__ThisHost singleton is fixed. After MT-lock we must to check sm_single_instance again.

This commit is a part of work for #247.

…eric and LocalOperations

This patch deletes a duplication of port manager code.

Now utils.reserve_port and utils.release_port works through _old_port_manager - it is a global instance of PortManager__Generic that uses a global instance of LocalOperations.

This commit is a part of work for postgrespro#247.
@dmitry-lipetsk
Copy link
Collaborator Author

PR was tested with probackup2

After MT-lock we must to check __class__.sm_single_instance again.

Refactoring
 - PortManager__ThisHost::__new__ is replaced with an explicit PortManager__ThisHost::get_single_instance()
 - PortManager__ThisHost::__init__ is deleted
@dmitry-lipetsk dmitry-lipetsk merged commit a683c65 into postgrespro:master May 5, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant