Fossil SCM
Communication failure does not lead to exit(EXIT_FAILURE)
bc0d0f5642eaf9b…
· opened 14 years, 7 months ago
- Type
- Code_Defect
- Priority
- —
- Severity
- Important
- Resolution
- Open
- Subsystem
- —
- Created
- Aug. 16, 2011 7:49 p.m.
Reported on the mailing list together with an example of why that's bad...
martin.weber added on 2011-08-17 02:20:43 UTC: ISTM (by looking at src/http_transport.c) that errors from the communication on either level (http; socket) will not get propagated to the state (struct state in the given file); and as the functions that are doing the (http transport) work do not return a status indicator whether or not operations worked (returning void instead of int, ssize_t or the like) the caller won't know.
For error handling, there is access to the error code / message on the socket layer, but aside from "not having a socket open" no error state gets propagated to the http/transport code layer AFAICS.
client_sync() still returns the amount of errors that have accumulated during attempting the sync (with not having a socket connection being one of the potential errors), but the return value from it is being ignored in callers pull/push/sync_cmd. So the path to fixing this problem would be to start paying attention what client_sync() actually is returning...