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

Warn instead of trace when errors happen in the spin_redis_engine #2231

Merged

Conversation

karthik2804
Copy link
Contributor

Changes the tracing level to warn as otherwise it leads to cases where the module errored and it looks like Spin hanged. I ran into this while using an invalid component. I could not understand its cause until @dicej recommended switching from debug to trace.

@karthik2804 karthik2804 requested review from itowlson and dicej January 18, 2024 21:44
Copy link
Contributor

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This does raise the question of why we're silently dropping errors here: https://github.com/fermyon/spin/blob/main/crates/redis/src/lib.rs#L97 -- there's a non-trivial amount of code dedicated to tracking and collecting errors in that file, and yet we end up just swallowing them completely.

@karthik2804
Copy link
Contributor Author

@dicej what would be the recommended way of handling it? add some tracing there?

@dicej
Copy link
Contributor

dicej commented Jan 18, 2024

I would suggest doing a tracing::warn in the RedisTrigger::run loop instead of dropping the error (which would make the change you already made unnecessary). Either that, or stick with your current change and remove the Result<()> return types from RedisTrigger::handle and RedisExecutor::execute since they're just ignored anyway.

@itowlson
Copy link
Collaborator

Moving alerting up to the top level would also flag errors that happen before the Wasm module gets called - looks like there are places during load/instantiate where that could happen?

Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
@karthik2804 karthik2804 force-pushed the improve_redis_trigger_warn branch from a0575c3 to 061cdeb Compare January 18, 2024 22:24
@karthik2804
Copy link
Contributor Author

@dicej @itowlson - I have updated the PR.

@karthik2804 karthik2804 merged commit c25b685 into spinframework:main Jan 18, 2024
11 checks passed
@karthik2804 karthik2804 deleted the improve_redis_trigger_warn branch January 18, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants