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

Fix #1325 by handling the exception #1335

Merged
merged 2 commits into from
Dec 9, 2024
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
21 changes: 13 additions & 8 deletions sarracenia/flowcb/post/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,21 @@ def __init__(self, options):
self.poster = sarracenia.moth.Moth.pubFactory(props)

def post(self, worklist):

still_ok = []
old_ok = worklist.ok
worklist.ok = []
all_good=True
for m in worklist.ok:
if all_good and hasattr(self.poster,'putNewMessage') and self.poster.putNewMessage(m):
still_ok.append(m)
else:
all_good=False
for m in old_ok:
try:
if all_good and hasattr(self.poster,'putNewMessage') and self.poster.putNewMessage(m):
worklist.ok.append(m)
else:
all_good=False
worklist.failed.append(m)
except Exception as e:
all_good = False
worklist.failed.append(m)
worklist.ok = still_ok
logger.error(f"crashed: {e}")
logger.debug("Exception details:", exc_info=True)

def metricsReport(self) -> dict:
if hasattr(self,'poster') and self.poster:
Expand Down
Loading