Skip to content
Merged
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 @@ -80,6 +80,7 @@ public ContainerInfo getContainer(final long size,
*/

ContainerInfo containerInfo = null;
String failureReason = null;

//TODO we need to continue the refactor to use repConfig everywhere
//in downstream managers.
Expand Down Expand Up @@ -136,11 +137,16 @@ public ContainerInfo getContainer(final long size,
} catch (IOException e) {
LOG.warn("Waiting for one of pipelines {} to be OPEN failed. ",
allocatedPipelineIDs, e);
failureReason = "Waiting for one of pipelines to be OPEN failed. "
+ e.getMessage();
}
} else {
failureReason = se.getMessage();
}
} catch (IOException e) {
LOG.warn("Pipeline creation failed for repConfig: {}. "
+ "Retrying get pipelines call once.", repConfig, e);
failureReason = e.getMessage();
}

pipelineManager.acquireReadLock();
Expand All @@ -166,12 +172,14 @@ public ContainerInfo getContainer(final long size,
}
}

// we have tried all strategies we know and but somehow we are not able
// to get a container for this block. Log that info and return a null.
// we have tried all strategies we know but somehow we are not able
// to get a container for this block. Log that info and throw an exception.
LOG.error(
"Unable to allocate a block for the size: {}, repConfig: {}",
size, repConfig);
return null;
throw new IOException(
"Unable to allocate a container to the block of size: " + size
+ ", replicationConfig: " + repConfig + ". " + failureReason);
}

private List<Pipeline> findPipelinesByState(
Expand Down