Skip to content

Fix error 'Is another postmaster already running on port XXX' #120

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
merged 1 commit into from
Apr 5, 2024

Conversation

MetalDream666
Copy link
Contributor

Sometimes when we abnormally shutdown node its port stays busy. So I added retry attempts to start() function in case we encounter such error

raise Exception
elif out and 'Is another postmaster already running on port' in out and startup_retries > 0:
self.port = reserve_port()
options['port'] = str(self.port)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 упал

  • flake8 .
    ./build/lib/testgres/node.py:737:21: F821 undefined name 'options'
    ./build/lib/testgres/node.py:738:40: F821 undefined name 'options'
    ./testgres/node.py:737:21: F821 undefined name 'options'
    ./testgres/node.py:738:40: F821 undefined name 'options'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переделала, тесты прошли

@MetalDream666 MetalDream666 force-pushed the fix-already-used-port-startup-error branch 6 times, most recently from 6f57364 to 8a5e75f Compare April 5, 2024 15:21
@MetalDream666 MetalDream666 force-pushed the fix-already-used-port-startup-error branch 2 times, most recently from 242e01f to 63e2061 Compare April 5, 2024 15:39
Sometimes when we abnormally shutdown node its port stays busy. So I
added retry attempts to start() function in case we encounter such
error. Test for this case was added (test_the_same_port).
@MetalDream666 MetalDream666 force-pushed the fix-already-used-port-startup-error branch from 63e2061 to fba3bd3 Compare April 5, 2024 16:23
@MetalDream666 MetalDream666 merged commit 4766f93 into master Apr 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants