Closed Alenar closed 4 months ago
4 files ± 0 51 suites ±0 8m 51s :stopwatch: -3s 1 114 tests +13 1 114 :white_check_mark: +13 0 :zzz: ±0 0 :x: ±0 1 262 runs +13 1 262 :white_check_mark: +13 0 :zzz: ±0 0 :x: ±0
Results for commit 35138ade. ± Comparison against base commit 5816ed46.
:recycle: This comment has been updated with latest results.
I'm wondering about what will happen during the cleanup for the REST API of the aggregator: will it be locked? Can we handle that situation with a
503
response?
@jpraynaud Currently if the repository layer fails because of an error (most likely a SQLITE_BUSY
error in this case) the REST api returns a 500
response most of the time.
Returning another error code is possible:
To do so we need to rework the pub fn internal_server_error<T: Into<InternalServerError>>(message: T) -> Box<dyn warp::Reply>
from mithril-aggregator/src/http_server/routes/reply.rs
.
It would only take StdError
as parameter so it could downcast ref it to a sqlite crate error, check the error code, see if it correspond to an SQLITE_BUSY
and if yes changes the response from a 500
to a 503
.
What do you think ?
I'm wondering about what will happen during the cleanup for the REST API of the aggregator: will it be locked? Can we handle that situation with a
503
response?@jpraynaud Currently if the repository layer fails because of an error (most likely a
[SQLITE_BUSY](https://www.sqlite.org/rescode.html#busy)
error in this case) the REST api returns a500
response most of the time.Returning another error code is possible:
To do so we need to rework the
pub fn internal_server_error<T: Into<InternalServerError>>(message: T) -> Box<dyn warp::Reply>
frommithril-aggregator/src/http_server/routes/reply.rs
. It would only takeStdError
as parameter so it could downcast ref it to a sqlite crate error, check the error code, see if it correspond to anSQLITE_BUSY
and if yes changes the response from a500
to a503
.What do you think ?
I was thinking about a warp middleware that would return a 503
when the UpkeepService
is running the cleanup (and that would be used on the routes which are impacted by the cleanup). But your solution can work as well :+1:
Content
This PR add a new service to
mithril-aggregator
andmithril-signer
, theUpkeepService
:Idle → Ready
state machine transition, while the registration round is close.Unregistered → Registered
state machine transition.pragma wal_checkpoint(TRUNCATE)
on both the main and the cardano transaction database to avoid infinite grow of the wal files.Note: the vacuum is not run on the cardano transaction database as it can be so large that it takes more than an hour on the mainnet.
Pre-submit checklist
Issue(s)
Closes #1707