Conversation
|
@stgraber, quick notes and questions.
|
a067f27 to
bcc79c4
Compare
Yeah, request validation should happen as early as possible, so directly in the Post handler would be good. |
I don't think there's any particular reason for that. The package setup for backups is a bit unusual so that may have had something to do with it. In practice, so long as it's done in a spot that's reliable, we're fine :) |
Nah, very few operations are cancellable, it's basically limited to operations that download stuff from the Internet and which can therefore be easily cancelled. In the case of streaming backups out, the background operation wouldn't even really be needed as the API call is synchronous in this case and a cancellation would come in the way of a closed connection from the user having closed their side of the connection. That will make all write operations fail which will in turn cancel everything. |
Alright, I’m wondering if streamed backups should trigger a lifecycle event. I don’t know if these events implicitly convey some kind of object creation on the server, in which case they should be disabled.
Well, closing a pipe is also pretty easy, it’s just that I felt lazy.
Agreed, but I think it’s pretty nice to have a reporting that this action is currently running. In a way, console access isn’t completely asynchronous either, from a high level (there’s bidirectional data that can only flow if the consumer stays there). |
|
Maybe I’m whatifing too much :) |
The event should be emitted. Lifecycle events are meant for auditing activity on an Incus server. |
bcc79c4 to
e32d1d1
Compare
|
Eh, there are quite a few more edge cases to fix. Pipes are fun. I also need to prevent creating DB entries. |
8e04e1f to
4fac193
Compare
|
Alright, that should be good now. |
| return nil | ||
| } | ||
|
|
||
| type pipeResponse struct { |
There was a problem hiding this comment.
Not necessarily opposed to introducing this simpler response type, but what was the issue with using FileResponse instead?
I thought we had support for streaming data out like that by using a single file with the following set:
- Identifier
- Filename
- File
- FileSize
- FileModified
There was a problem hiding this comment.
The issue is this: https://cs.opensource.google/go/go/+/refs/tags/go1.25.7:src/net/http/fs.go;l=247
We really don’t want to seek to the end of our stream :)
And there are plenty of other hidden features of ServeContent that are not well-suited for streamed data.
|
This actually ended up looking a lot cleaner than I expected ;) |
|
Ok I’ll do those quick patches later today. |
|
I got caught up in other matters, I’m looking into this now. |
e1bb401 to
e226cbf
Compare
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Signed-off-by: Benjamin Somers <[email protected]>
Closes: #2807