-
Notifications
You must be signed in to change notification settings - Fork 211
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
"error in read()" error messages #78
Comments
One more datapoint... We have also seen those errors with
|
@AlexDavies501 thanks for the report! Could you provide some additional info about the software and hardware environment you're running? Kernel version, platform, etc. |
Hi. Edited
The hardware is a Technologics 7970 embedded computer. Has two serial ports. We run mbusd against one of these.
The config file now looks like:
With the above config i see a dozen Originally, when we saw a lot more of these errors (several hundred per day), the config had There are 3 regular callers that create Modbus master connections to the TCP side of mbusd. These tend to do a poll of a handful of registers every 5 seconds. Also some occasional scripts manually called from the cmdline that make connections too. There are two slave devices on the 485 network: a gateway device and a pressure transmitter. |
Hi, thanks for the info! I've pushed some fixes regarding handling EAGAIN read() result. Сould you test mbusd compiled from the latest sources? |
Many thanks for the quick turn around. Will try to test a fix next week. The actual system in question is several thousand miles away... |
Apologies for the late response - the well the device was on was shut for a several weeks. System turned off. We've been using the fix on some other sites and have not seen the original error messages there. So i would vote to close the issue. Many thanks for the fast response and fix! |
Glad to hear the problem is sorted out! So I'm closing this issue, please feel free to reopen if needed. |
fyi
We were seeing a lot of mbusd errors in
journalctl
of the formAfter reducing the
retries
from 3 to zero, they've gone from being every minute,to every few hours.
Looking at the code where the
error in read
is generated:and
...they both come from
conn_read()
returning<= 0
.And
conn_read
is:The printed error message = Resource temporarily unavailable = strerror(EAGAIN)
So suspect
read()
returns -1 and sets errno to EAGAIN.This would be due to no data being available and the descriptor being O_NONBLOCK.
Not sure if this is actually an error in this case that requires the subsequent
tty_reinit()
call.Maybe
conn_read()
could retry the readN
times afterrc == -1 && errno == EAGAIN
?Reporting in case this is of interest.
Thanks!
The text was updated successfully, but these errors were encountered: