- Notifications
You must be signed in to change notification settings - Fork35
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -726,14 +726,30 @@ def start(self, params=[], wait=True): | ||
"start" | ||
] + params # yapf: disable | ||
startup_retries = 5 | ||
while True: | ||
try: | ||
exit_status, out, error = execute_utility(_params, self.utils_log_file, verbose=True) | ||
if error and 'does not exist' in error: | ||
raise Exception | ||
except Exception as e: | ||
files = self._collect_special_files() | ||
if any(len(file) > 1 and 'Is another postmaster already ' | ||
'running on port' in file[1].decode() for | ||
file in files): | ||
print("Detected an issue with connecting to port {0}. " | ||
"Trying another port after a 5-second sleep...".format(self.port)) | ||
self.port = reserve_port() | ||
options = {} | ||
options['port'] = str(self.port) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. flake8 упал
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Переделала, тесты прошли | ||
self.set_auto_conf(options) | ||
startup_retries -= 1 | ||
time.sleep(5) | ||
continue | ||
msg = 'Cannot start node' | ||
raise_from(StartNodeException(msg, files), e) | ||
break | ||
self._maybe_start_logger() | ||
self.is_started = True | ||
return self | ||