Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

pcercuei
Copy link
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
iiod/ops.c Show resolved Hide resolved
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
Contributor Author

Updated.

@rgetz
Copy link
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
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