Open Joacchim opened 10 years ago
The retry mechanism should be tested (a server failing half the time should be enough, as long as it's an error that is returned by the kernel code, and not a wrong response). Disconections should be a good way to test this.
Currently, we can identify two kinds of retry mechanisms within the driver: 1) numbered retry mechanisms in srb_driver.c:349 (srb_xfer_scl): -> Retry up until a configured number of times 2) automatic retry mechanisms on -EPIPE within srb_cdmi.c:337 (send_sock_receive) and srb_cdmi.c:400 (send_sock_sglist_receive) -> In case of closed connection (read==0 or EPIPE), retry connecting, re-sending the request, read the response.
I feel that the best way to manage that would be to only have retry mechanisms in one place, in order to both harmonize and reduce effort duplication. I think the best place for this is just on top of the primitive functions, within srb_cdmi.c. It should also take a number of retries as parameter, in order to still be flexible.
This issue was spawned by #59