Skip to content
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

AMBARI-24309. Hadoop Metrics Sink Precheck takes 5 minutes to complet… #1796

Merged
merged 1 commit into from Jul 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions ambari-common/src/main/python/ambari_commons/shell.py
Expand Up @@ -494,6 +494,7 @@ def error_handler(command, error_log, exit_code):
yield []
return
kill_timer = threading.Timer(timeout, lambda: cmd.kill())
kill_timer.daemon = True
if timeout > -1:
kill_timer.start()

Expand All @@ -512,8 +513,6 @@ def error_handler(command, error_log, exit_code):
if error_callback and cmd.returncode and cmd.returncode > 0:
error_callback(command, cmd.stderr.readlines(), cmd.returncode)
except Exception as e:
if kill_timer:
kill_timer.cancel()
_logger.error("Exception during command '{0}' execution: {1}".format(command, str(e)))
if error_callback:
error_callback(command, [str(e)], -1)
Expand All @@ -522,6 +521,9 @@ def error_handler(command, error_log, exit_code):
finally:
if buff_queue:
buff_queue.notify_end()
if kill_timer:
kill_timer.cancel()
kill_timer.join()


def get_all_children(base_pid):
Expand Down