Better clean up of blobs
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by tracing the blob HTTP GET path and the request data that can indicate whether a blob should persist. Review the separate programming-client and UI cases described in the issue, including short and long-running tasks. Done means a GET removes the blob by default while an explicit persistence request preserves it, without breaking clients that need the data.
Written by the indexing model from the issue text.
Description
Blobs currently live for a fixed time on the server. This means that any blob that creates a sizeable chunk of data that is run often could waste a fair amount of space.
Proposal
Delete the blob when it is read with GET, unless the data attached to the specific GET call specifies that the blob should remain.
Effects
The HTTP API tends to be used for two use cases - The UI, programming clients. It is worth considering these separately.
From a Programming client
I cannot think of many cases where a programming client would want to get the data multiple times (or multiple clients get the data). I don't deny there may be a specific use case, but the ability to request that the blob persists allows someone writing a client to do this if there edge case allows.
UI
I think it is worth considering short and long running tasks separately.
- Short tasks - (For example: Capturing an image)
- If I have a client open and capture an image I don't expect a different client to be able to access it
- If I select capture and then close the client before it finishes, I don't expect I will ever get that image (It will in this case sit on the server for 5 mins)
- If I have 2 clients open, or open a second one mid-capture I don't expect the second client should receive the image as well
- Long-running task - (For example: Sample scanning) - Returning a blob for such a long running task is a bad idea in the first place as there is a high chance that no client is still open to receive the blob on completion. We will also always want the UI to reconnect to long-running actions, which means that the chance of multiple clients being sent a blob is high, which always seems like it is confusing.
All of these cases imply that the blob being deleted on first GET is fine.
For the short task we probably (In OpenFlexure Microscope) will need to make sure that short tasks don't auto-connect to ongoing actions as a second client could receive the image of captured by another client. This is already weird behaviour, but would be doubly bad if this issue is implemented as the client that captured may not actually receive the requested image.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labthings/labthings-fastapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
labthings/labthings-fastapi#405 ·
-
drop-python-version
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
labthings/labthings-fastapi#354 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
labthings/labthings-fastapi#312 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
labthings/labthings-fastapi#404 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
labthings/labthings-fastapi#403 · 1 comment ·
All issues in labthings/labthings-fastapi
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/Repo2RLEnv#163 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·