ECP-VeloC / AXL

Asynchronous Transfer Library
MIT License
2 stars 8 forks source link

Checking for errors in the file rename step #78

Open adammoody opened 3 years ago

adammoody commented 3 years ago

AXL_Test is only meant to tell the caller whether calling AXL_Wait will block or not. The caller must always call AXL_Wait whether they have called AXL_Test or not. We don't want AXL_Test to do any "complete" work, it should only check and report status. Thus, we don't want to rename files here:

https://github.com/ECP-VeloC/AXL/blob/d738fb7a973367f57d9480cba9b2b63717920374/src/axl.c#L789

Also, we should consider a failed rename call to be a failed transfer. We should detect and report errors there, since it could mean that the temporary file never actually changed to the final file name:

https://github.com/ECP-VeloC/AXL/blob/d738fb7a973367f57d9480cba9b2b63717920374/src/axl.c#L723

We might also want to consider a transfer to have failed if we fail to copy the metadata:

https://github.com/ECP-VeloC/AXL/blob/d738fb7a973367f57d9480cba9b2b63717920374/src/axl_io.c#L615

adammoody commented 3 years ago

Fixing this in https://github.com/ECP-VeloC/AXL/pull/80/commits/1ac255af66c448c19e699b901b7e743205007029

adammoody commented 3 years ago

Resolved with https://github.com/ECP-VeloC/AXL/pull/80

adammoody commented 3 years ago

Oh, wait. The metadata issue is still unresolved. Will keep this open until that's also addressed.