Repository navigation
Conversation
lisandroct
left a comment
There was a problem hiding this comment.
I have other comments/concerns besides the other two:
- Claude reported that with these changes we would be getting duplicated reports in V8: "
v8/error.rs:617already writes the JS error and its stack trace to the module logs at Panic level, and this adds a second Error-level entry for the same failure." - I believe we should also handle views and report this same out of energy error there. Views also call
handle_outer_error, so maybe we can move the report over there? - I'm not super familiar with all of our errors and just based on the name
OutOfEnergyI wonder, do we throw this error if the user's energy balance is low too? If we do, the message "maximum CPU usage allowed per reducer call" would not be the appropriate one.
| "reducer aborted after {:.2?}: {reason}", | ||
| result.stats.timings.total_duration | ||
| ); | ||
| log_reducer_error( |
There was a problem hiding this comment.
We're calling handle_outer_error (in line 1245) which increments WORKER_METRICS.wasm_instance_errors. We were already doing that.
Now we're calling log_reducer_error here which increments WORKER_METRICS.sender_errors.
So we will be incrementing two different error counters, which is probably not what we want.
| ); | ||
| log_reducer_error( | ||
| inst.replica_ctx(), | ||
| timestamp, |
There was a problem hiding this comment.
Shouldn't we use InstanceEnv::now_for_logging() here?
|
@lisandroct
The energy system that exists on the website to track people's usage is unrelated to this fuel limit. This is an old system in place to prevent reducers from accidentally (or intentionally) running for too long. It's not great, but right now it's also silent which is even worse. |
536bc43 to
e7f9380
Compare
Description of Changes
Whenever we abort a reducer because it used the maximum allowed cpu usage (fuel) the database logs don't show anything.
This means that the reason for the error is completely hidden to end users who don't have access to host logs.
This PR add that error to the database logs.
API and ABI breaking changes
No
Rollback safety impact
n/a
Expected complexity level and risk
1
Testing
I didn't test this, but the code is very simple so I believe compilation and existing unit tests are sufficient.