printer: ignore EAGAIN and EINTR errno#903
Merged
michalvasko merged 1 commit intoCESNET:masterfrom Oct 16, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #903 +/- ##
==========================================
+ Coverage 74.77% 74.77% +<.01%
==========================================
Files 34 34
Lines 40119 40121 +2
Branches 10171 10172 +1
==========================================
+ Hits 29997 29999 +2
Misses 10122 10122 |
Member
|
Hi, Regards, |
Collaborator
Author
|
@michalvasko That is a little better indeed, I'll submit an update. |
When using libnetconf2 via the UNIX or FD transport and sending large configs, we can get the following error from libyang: Print error (Resource temporarily unavailable). Do not fail when errno holds EAGAIN or EINTR. These are not errors. This can occur when using ly_print_clb with a callback that does I/O on a non-blocking file or if the application received a signal during the write syscall. If the callback function returns a zero or positive value, reset errno so that LY_PRINT_RET does not return an error. Fixes: 609d708 ("printer CHANGE use errno to check for printer errors") Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
de1f602 to
75e3580
Compare
Member
|
Hi, Regards, |
Contributor
|
hi, @michalvasko , will this commit apply to devel branch too ? otherwise, these two branches will diverge. |
Member
|
Yes, it was already merged. |
Collaborator
Author
|
Thanks @michalvasko |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using libnetconf2 via the UNIX or FD transport and sending large configs, we can get the following error from libyang:
Do not fail when errno holds
EAGAINorEINTR. These are not errors. This can occur when using ly_print_clb with a callback that does I/O on a non-blocking file or if the application received a signal during the write syscall.Ideally, we should check the return value of every
ly_printcall but it would be rather tedious and would make the code clobbered.Fixes: 609d708 ("printer CHANGE use errno to check for printer errors")