irods / irods_client_http_api

An iRODS C++ HTTP API using Boost.Beast
BSD 3-Clause "New" or "Revised" License
0 stars 7 forks source link

Provide status and cancellation API for active transfers #188

Open mstfdkmn opened 8 months ago

mstfdkmn commented 8 months ago

Bug Report

iRODS Version, OS and Version

4.3.1, almalinux8

What did you try to do?

While writing I cut the signal (ctr+c).

Expected behavior

The object could be in stale X for some moment or immediately or a bit later in good &

Observed behavior (including steps to reproduce, if applicable)

The object gets locked.

[irods@dev-u0137480 go-http-client]$ time curl -H "Authorization: Bearer $token" 'http://localhost:9000/irods-http-api/0.1.0/data-objects' -F  'op=write' -F 'lpath=/u0137480/home/rods/myfile.txt' -F 'count=125000' -F 'bytes=abcdfg'
^C

real    0m3.778s
user    0m0.003s
sys     0m0.006s
[irods@dev-u0137480 go-http-client]$ ils -L /u0137480/home/rods/myfile.txt
  rods              0 default            0 2023-12-22.17:06 ? myfile.txt
        generic    /vault/home/rods/myfile.txt
trel commented 8 months ago

I believe once the server connection times out, it will shift to X, or stale. But the server probably was not told the client connection went away. We will work to reproduce.

korydraughn commented 8 months ago

That's correct. The operation does not know the client disappeared, which isn't incorrect. Perhaps the client doesn't care about the response. Of course, that makes resolving this issue slightly more difficult.

What if the HTTP API provided a way for admins to view active transfers? Hmm ...

Again, the behavior is unknown due to the mismatch values of the count and bytes params.

trel commented 8 months ago

Right. So, once we resolve the mismatch scenario... this particular issue will become more clear.

korydraughn commented 8 months ago

The parameter mismatch issue has been resolved by #194.

Even with the parameter issue resolved, I think we may want to provide a way to cancel a transfer. Which implies we have to provide a way to view active transfers.

Thoughts?

trel commented 8 months ago

Who would be able to cancel a transfer? Presumably just admins.

And for what scenario can they not just ... wait for timeout?

Not sure the added complexity / states are worth the effort.

Do any other HTTP services provide these kinds of insight/listing/cancel button?

korydraughn commented 8 months ago

Who would be able to cancel a transfer? Presumably just admins.

Admins would be able to view all transfers. Non-admins would be able to view just their transfers.

And for what scenario can they not just ... wait for timeout?

With #194 handled, all transfers should end eventually.

This idea would help in situations where the amount of data being transferred is very large.

Not sure the added complexity / states are worth the effort.

Do any other HTTP services provide these kinds of insight/listing/cancel button?

I'm not sure what other HTTP APIs provide, but this idea doesn't sound out of bounds for iRODS. I agree the added complexity may not be worth the effort though.

I'm convinced we should wait until more users appear before adding something like this.

trel commented 8 months ago

I'm convinced we should wait until more users appear before adding something like this.

Agreed.

trel commented 8 months ago

Perhaps update the title to be... 'provide status and cancellation API for running transfers'