Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Add more Quote status codes to indicate failure modes #21

Closed
MantisClone opened this issue Oct 18, 2022 · 3 comments · Fixed by #65 or #68
Closed

Add more Quote status codes to indicate failure modes #21

MantisClone opened this issue Oct 18, 2022 · 3 comments · Fixed by #65 or #68
Assignees

Comments

@MantisClone
Copy link
Owner

MantisClone commented Oct 18, 2022

When a quote is being processed, there are many different ways that it could fail. Some of these failures (like missing or insufficient approval) are non-recoverable failures. Other failures (like rate-limited node providers, arweave server dies, IPFS gateway down) are recoverable failures that can be resolved with retries.

When non-recoverable failures occur, refund the user's funds.
When recoverable failures occur, retry some number of times, and eventually convert to non-recoverable failure and refund user's funds.

If the Arweave Upload server dies midway through processing a quote, it needs to restart the quote upon server startup.

To do this, we need to store error status codes in the database.

Possible solution:

  • 201-299 = Processing payment failure modes
  • 401-499 = Upload failure modes

On server startup, look through the database and restart any quotes with status 201-299 or 401-499.

@MantisClone MantisClone changed the title Implement permanent failure mode Add more Quote status codes to indicate failure modes Oct 19, 2022
@MantisClone
Copy link
Owner Author

@alexcos20 updated the DBS spec (and by extension the Arweave Upload Spec) to include more status codes.

Status Status Description
0 No such quote
1-99 Waiting for files to be uploaded by the user
100-199 Processing payment
200-299 Processing payment failure modes
300-399 Uploading files to storage
400 Upload done
401-499 Upload failure modes

Reference: oceanprotocol/uploader_backend#1 (comment)

@balessan
Copy link

@MantisClone be careful that if you modify the specification too much it could make our (the Startin'blox) budget out-of-date.

The overall idea is good and needs to be considered though. Thanks for the input on the status code and different scenario.

@MantisClone
Copy link
Owner Author

@balessan Agreed, we are cautious about changing the spec. But this was a necessary change - otherwise, if our server died half way through processing a payment, it would be impossible for us to know where to resume it.

@MantisClone MantisClone moved this from Todo to In Progress in Arweave Upload Microservice Oct 24, 2022
@MantisClone MantisClone moved this from In Progress to Todo in Arweave Upload Microservice Oct 24, 2022
@MantisClone MantisClone moved this from Todo to In Progress in Arweave Upload Microservice Oct 25, 2022
@MantisClone MantisClone linked a pull request Oct 27, 2022 that will close this issue
Repository owner moved this from In Progress to Done in Arweave Upload Microservice Oct 28, 2022
@MantisClone MantisClone moved this from Done to In Progress in Arweave Upload Microservice Oct 28, 2022
@MantisClone MantisClone reopened this Oct 28, 2022
@MantisClone MantisClone linked a pull request Oct 28, 2022 that will close this issue
Repository owner moved this from In Progress to Done in Arweave Upload Microservice Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
3 participants