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

Some log fix #336

Merged
merged 2 commits into from
Aug 10, 2023
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
9 changes: 4 additions & 5 deletions example/definitions/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ spec:
- topic: stdout
error::ZeroDivisionError:
- topic: logging-error
- error_handler:
set_handled: false
republish:
channel: default
max_retry: 5
- set_handled: false
- republish:
channel: default
max_retry: 1

pipeline:
name: example.pipelines.echo_with_error
Expand Down
4 changes: 4 additions & 0 deletions example/tests/pipeline_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
module: 'example.pipelines'
message: division by zero
traceback: __any__
- channel: default
args:
api_key: {key: test, name: test-key-1}
message: test-hello
resources: []
---
apiVersion: saturn.flared.io/v1alpha1
Expand Down
5 changes: 0 additions & 5 deletions src/saturn_engine/worker/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ async def item_to_topic(self, item_ctx: Item) -> t.AsyncIterator[TopicMessage]:
try:
async with item_ctx as item:
yield item.as_topic_message()
except Exception:
self.logger.exception(
"Failed to process item",
extra={"data": {"message": {"id": item_ctx.id}}},
)
finally:
self._set_item_done(item_ctx)

Expand Down
3 changes: 2 additions & 1 deletion tests/worker/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def fail() -> None:
# |0|1|2|3|4|5|6|
# -> |.|.|R|.|.|R|.|
# Nothing commited.
await xmsg_ctxs[2].aclose()
with pytest.raises(ValueError):
await xmsg_ctxs[2].aclose()
await xmsg_ctxs[5].aclose()
assert job_state_store.job_state(job_id).cursor is None

Expand Down
Loading