|
1 | 1 | package org.labkey.cluster.pipeline; |
2 | 2 |
|
3 | 3 | import org.apache.commons.lang3.StringUtils; |
| 4 | +import org.apache.commons.lang3.math.NumberUtils; |
4 | 5 | import org.apache.logging.log4j.LogManager; |
5 | 6 | import org.apache.logging.log4j.Logger; |
6 | 7 | import org.jetbrains.annotations.NotNull; |
@@ -282,11 +283,21 @@ else if (headerFound) |
282 | 283 | // NOTE: if the line has blank ending columns, trimmed lines might lack that value |
283 | 284 | if (maxRssIdx > -1 && maxRssIdx < tokens.length) |
284 | 285 | { |
285 | | - long bytes = FileSizeFormatter.convertStringRepresentationToBytes(tokens[maxRssIdx]); |
286 | | - long requestInBytes = FileSizeFormatter.convertStringRepresentationToBytes(getConfig().getRequestMemory() + "G"); //request is always GB |
287 | | - if (bytes > requestInBytes) |
| 286 | + try |
288 | 287 | { |
289 | | - info = "Job exceeded memory, max was: " + FileSizeFormatter.convertBytesToUnit(bytes, 'G') + "G"; |
| 288 | + if (NumberUtils.isCreatable(tokens[maxRssIdx])) |
| 289 | + { |
| 290 | + long bytes = FileSizeFormatter.convertStringRepresentationToBytes(tokens[maxRssIdx]); |
| 291 | + long requestInBytes = FileSizeFormatter.convertStringRepresentationToBytes(getConfig().getRequestMemory() + "G"); //request is always GB |
| 292 | + if (bytes > requestInBytes) |
| 293 | + { |
| 294 | + info = "Job exceeded memory, max was: " + FileSizeFormatter.convertBytesToUnit(bytes, 'G') + "G"; |
| 295 | + } |
| 296 | + } |
| 297 | + } |
| 298 | + catch (IllegalArgumentException e) |
| 299 | + { |
| 300 | + _log.error("Unable to parse MaxRSS for job: " + job.getClusterId() + ", with line: [" + line + "]", e); |
290 | 301 | } |
291 | 302 | } |
292 | 303 | } |
|
0 commit comments