Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safeguard for parsing top command #409

Merged
merged 1 commit into from
Aug 6, 2024
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Change Log
==========

5.4.2
=====

* Safeguard against unexpected output from top command


5.4.1
=====

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tibanna"
version = "5.4.1"
version = "5.4.2"
description = "Tibanna runs portable pipelines (in CWL/WDL) on the AWS Cloud."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
9 changes: 8 additions & 1 deletion tibanna/top.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import datetime
from . import create_logger

logger = create_logger(__name__)


class Top(object):
Expand Down Expand Up @@ -100,7 +103,11 @@ def parse_contents(self, contents):
if is_in_table:
if timestamp not in self.processes:
self.processes[timestamp] = []
process = Process(line)
try:
process = Process(line)
except:
logger.info(f"Could not process line from top command: {line}")
continue
if not self.should_skip_process(process):
self.processes[timestamp].append(Process(line))

Expand Down
Loading