|
18 | 18 | import org.labkey.api.pipeline.PipeRoot; |
19 | 19 | import org.labkey.api.pipeline.PipelineJobException; |
20 | 20 | import org.labkey.api.pipeline.PipelineService; |
| 21 | +import org.labkey.api.pipeline.PipelineStatusFile; |
21 | 22 | import org.labkey.api.query.FieldKey; |
22 | 23 | import org.labkey.api.security.User; |
23 | 24 | import org.labkey.api.sequenceanalysis.RefNtSequenceModel; |
@@ -234,38 +235,60 @@ else if (!d.getFile().exists()) |
234 | 235 | } |
235 | 236 | } |
236 | 237 |
|
237 | | - if (m.getRunId() != null) |
| 238 | + inspectForCoreFiles(m.getRunId(), log); |
| 239 | + } |
| 240 | + } |
| 241 | + |
| 242 | + private void inspectForCoreFiles(Integer runId, Logger log) |
| 243 | + { |
| 244 | + if (runId == null) |
| 245 | + { |
| 246 | + return; |
| 247 | + } |
| 248 | + |
| 249 | + ExpRun run = ExperimentService.get().getExpRun(runId); |
| 250 | + if (run == null) |
| 251 | + { |
| 252 | + log.info("Not ExpRun found for runId: " + runId); |
| 253 | + return; |
| 254 | + } |
| 255 | + else if (run.getJobId() == null) |
| 256 | + { |
| 257 | + log.info("ExpRun lacks jobId: " + runId); |
| 258 | + return; |
| 259 | + } |
| 260 | + |
| 261 | + PipelineStatusFile sf = PipelineService.get().getStatusFile(run.getJobId()); |
| 262 | + if (sf == null) |
| 263 | + { |
| 264 | + log.error("Unknown statusFile: " + run.getJobId() + ", for run: " + runId); |
| 265 | + return; |
| 266 | + } |
| 267 | + else if (sf.getFilePath() == null) |
| 268 | + { |
| 269 | + log.error("StatusFile filepath is null: " + run.getJobId() + ", for run: " + runId); |
| 270 | + return; |
| 271 | + } |
| 272 | + |
| 273 | + File root = new File(sf.getFilePath()); |
| 274 | + if (!root.exists()) |
| 275 | + { |
| 276 | + log.error("Run fileroot does not exist: " + runId + " / " + root.getPath()); |
| 277 | + return; |
| 278 | + } |
| 279 | + |
| 280 | + try (Stream<Path> stream = Files.walk(root.toPath())) |
| 281 | + { |
| 282 | + List<Path> files = stream.filter(x -> x.getFileName().startsWith("core.")).toList(); |
| 283 | + if (!files.isEmpty()) |
238 | 284 | { |
239 | | - ExpRun run = ExperimentService.get().getExpRun(m.getRunId()); |
240 | | - if (run == null) |
241 | | - { |
242 | | - log.info("Not ExpRun found for runId: " + m.getRunId()); |
243 | | - } |
244 | | - else if (run.getFilePathRootPath() == null) |
245 | | - { |
246 | | - log.error("Run fileroot is null for runId: " + m.getRunId()); |
247 | | - } |
248 | | - else if (!run.getFilePathRoot().exists()) |
249 | | - { |
250 | | - log.error("Run fileroot does not exist: " + m.getRunId() + " / " + run.getFilePathRoot()); |
251 | | - } |
252 | | - else |
253 | | - { |
254 | | - try (Stream<Path> stream = Files.walk(run.getFilePathRootPath())) |
255 | | - { |
256 | | - List<Path> files = stream.filter(x -> x.getFileName().startsWith("core.")).toList(); |
257 | | - if (!files.isEmpty()) |
258 | | - { |
259 | | - files.forEach(x -> log.error("Found core file: " + x.toFile().getPath())); |
260 | | - } |
261 | | - } |
262 | | - catch (IOException e) |
263 | | - { |
264 | | - log.error("Error walking file root: " + run.getFilePathRootPath(), e); |
265 | | - } |
266 | | - } |
| 285 | + files.forEach(x -> log.error("Found core file: " + x.toFile().getPath())); |
267 | 286 | } |
268 | 287 | } |
| 288 | + catch (IOException e) |
| 289 | + { |
| 290 | + log.error("Error walking file root: " + run.getFilePathRootPath(), e); |
| 291 | + } |
269 | 292 | } |
270 | 293 |
|
271 | 294 | private void processContainer(Container c, Logger log) throws IOException, PipelineJobException |
|
0 commit comments