Skip to content

IIOD: Better handle errors of iio_buffer_{refill,push}#996

Merged
pcercuei merged 1 commit intomasterfrom
pcercuei/iiod-handle-kernel-timeout
Jun 23, 2023
Merged

IIOD: Better handle errors of iio_buffer_{refill,push}#996
pcercuei merged 1 commit intomasterfrom
pcercuei/iiod-handle-kernel-timeout

Conversation

@pcercuei
Copy link
Copy Markdown
Contributor

Pass the error code to the connected clients, instead of disconnecting them.

This means that for a very slow device, a connected client will simply get a -ETIMEDOUT error when a configured timeout expires, and will still be able to communicate with the server.

Fixes: #981.

@pcercuei pcercuei force-pushed the pcercuei/iiod-handle-kernel-timeout branch from 1323fe5 to e1da15b Compare June 22, 2023 21:47
Pass the error code to the connected clients, instead of disconnecting
them.

This means that for a very slow device, a connected client will simply
get a -ETIMEDOUT error when a configured timeout expires, and will still
be able to communicate with the server.

Fixes: #981.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
@pcercuei pcercuei force-pushed the pcercuei/iiod-handle-kernel-timeout branch from e1da15b to 9209fe0 Compare June 23, 2023 08:02
@pcercuei
Copy link
Copy Markdown
Contributor Author

Updated.

@rgetz
Copy link
Copy Markdown
Contributor

rgetz commented Jun 23, 2023

Is the removal of all the IIO_ERROR() on purpose? We no longer print anything out when we use to....

if so - looks good to me - thanks

@pcercuei
Copy link
Copy Markdown
Contributor Author

Is the removal of all the IIO_ERROR() on purpose? We no longer print anything out when we use to....

Yes. Before, we considered that if iio_buffer_refill or iio_buffer_push_partial failed, it was an error of IIOD itself (something that should not happen), and IIOD would cancel and close the buffer.

Now, we consider that these errors might happen, but they are not errors of IIOD itself. The error codes are therefore sent back to the connected client(s).

@pcercuei pcercuei merged commit ad199c6 into master Jun 23, 2023
@pcercuei pcercuei deleted the pcercuei/iiod-handle-kernel-timeout branch June 23, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iio_buffer_refill() returns "bad file descriptor" error after timeout

3 participants