Skip to content

Conversation

@abstractdog
Copy link
Contributor

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

throw new RuntimeException("Container failed to be ready in " + MAX_STARTUP_WAIT/1000 +
" seconds");
printDockerEvents();
throw new RuntimeException("Container failed to be ready in " + MAX_STARTUP_WAIT/1000 +

Choose a reason for hiding this comment

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

Bit odd exception message. Minor stuff I know.
Container initialization is failed within x seconds. Please check the hive logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, odd, I'll change it

try {
runCmdAndPrintStreams(new String[] { "docker", "events", "--since", "24h", "--until", "0s" }, 3);
} catch (Exception e) {
LOG.info("Error while getting docker events, this was an analytical best effort step, no further actions...",

Choose a reason for hiding this comment

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

Alternative text: There was a problem encountered while attempting to retrieve Docker events. The system made an analytical best effort to resolve the issue, and at this point, no further actions are necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, I'll edit this one too
your message makes sense, except that "to resolve the issue" is not 100% true, docker events cmd just lists the docker events to make us able to guess what happened, so this would be the ideal one:

A problem was encountered while attempting to retrieve Docker events (the system made an analytical best effort to list the events to reveal the root cause). No further actions are necessary.

try {
runCmdAndPrintStreams(new String[] { "docker", "events", "--since", "24h", "--until", "0s" }, 3);
} catch (Exception e) {
LOG.info("Error while getting docker events, this was an analytical best effort step, no further actions...",

Choose a reason for hiding this comment

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

It should be warning. I guess it is more then an info, but not as important as an error. In an info message an "Error" could be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

Copy link
Member

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

LGTM. Since AbstractExternalDB is more or less a copy (unfortunately :( ) of DatabaseRule we may want to apply the same improvements there; it can be done as part of this PR or a separate one.

}
}

public void printDockerEvents() {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely not, I'll change,thanks

@abstractdog
Copy link
Contributor Author

abstractdog commented Apr 26, 2023

LGTM. Since AbstractExternalDB is more or less a copy (unfortunately :( ) of DatabaseRule we may want to apply the same improvements there; it can be done as part of this PR or a separate one.

makes sense, I'm porting changes to DatabaseRule now, otherwise I'll forget forever

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@abstractdog abstractdog merged commit d2ce078 into apache:master Apr 27, 2023
yeahyung pushed a commit to yeahyung/hive that referenced this pull request Jul 20, 2023
…Rule (apache#4268) (Laszlo Bodor reviewed by Stamatis Zampetakis)
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
…Rule (apache#4268) (Laszlo Bodor reviewed by Stamatis Zampetakis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants