Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ protected final LaunchInfo getJobInfo(LaunchConfig options, JobState state, Job
public JobState waitUntilActive(String project, String region, String jobId) throws IOException {
JobState state = getJobStatus(project, region, jobId);
boolean logOnce = false;
while (PENDING_STATES.contains(state)) {
while (PENDING_STATES.contains(state) || state == JobState.UNKNOWN) {
if (!logOnce) {
LOG.info("Job still pending. Will check again in 15 seconds");
LOG.info("Job still pending or unknown. Will check again in 15 seconds");
logOnce = true;
Comment on lines +319 to 322

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Waiting indefinitely when the job state is UNKNOWN can lead to infinite loops and hang the integration test suite in CI/CD pipelines if the job fails to initialize or is permanently in an unknown state. Consider adding a maximum retry limit or timeout for the UNKNOWN state to prevent potential hangs.

    int unknownStateCount = 0;
    while (PENDING_STATES.contains(state) || state == JobState.UNKNOWN) {
      if (state == JobState.UNKNOWN) {
        unknownStateCount++;
        if (unknownStateCount > 10) {
          throw new RuntimeException("Job state remained UNKNOWN for too long (exceeded 150 seconds).");
        }
      } else {
        unknownStateCount = 0;
      }
      if (!logOnce) {
        LOG.info("Job still pending or unknown. Will check again in 15 seconds");
        logOnce = true;

}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ public synchronized void cleanupAll() throws IcebergResourceManagerException {
dropNamespace(namespace, true);
}
createdNamespaces.clear();
if (cachedCatalog instanceof AutoCloseable) {
try {
((AutoCloseable) cachedCatalog).close();
} catch (Exception e) {
LOG.warn("Error closing Iceberg catalog", e);
}
}
cachedCatalog = null;
LOG.info("Cleaned up all resources for test ID: {}.", testId);
}

Expand Down
Loading