[RM] Bug Prevent SF crashing when fetching broken matrices
@@ -35,6 +35,7 @@ import com.exactpro.sf.testwebgui.api.TestToolsAPI;
public class MatrixHolder implements IMatrixListener {
private static final Logger logger = LoggerFactory.getLogger(MatrixHolder.class);
+ public static final Logger USER_EVENTS_LOG = LoggerFactory.getLogger("USER_EVENTS_LOG");
private final IWorkspaceDispatcher wd;
private final IMatrixStorage matrixStorage;
@@ -80,6 +81,7 @@ public class MatrixHolder implements IMatrixListener {
while (iterator.hasNext()) {
IMatrix matrix = iterator.next();
boolean removeMatrix = false;
+ try {
if (!wd.exists(FolderType.MATRIX, matrix.getFilePath())) {
if (StringUtils.isNoneEmpty(matrix.getLink())) {
try {
@@ -94,6 +96,10 @@ public class MatrixHolder implements IMatrixListener {
logger.warn("cant find matrix file by specified path {}, matrix will be removed", matrix.getFilePath());
}
}
+ } catch (RuntimeException e) {
+ removeMatrix = true;
+ USER_EVENTS_LOG.warn("Broken matrix found {}. Removing it from storage", matrix);
+ }
if (removeMatrix) {
logger.warn("Removing matrix from storage {} ", matrix);
matrixStorage.removeMatrix(matrix);
