-
Notifications
You must be signed in to change notification settings - Fork 42
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
option to exit on error instead of retrying #14
Comments
The eventual lock when looking for serial device to return is not good. That needs to just work. Outside of that an option to die on specific errors seems like a simple switch to add. Just inject a test for the flag and exit at specific points. It sounds like you are not using the -c switch that should keep connections out until serial returns. The purpose of this switch was to avoid the situation you describe except the lockup problem. |
I thought -c specifically allowed connections even if the serial is missing. Looking at the code it looks like it does what it says: if the serial is connected OR that flag is set, continue as if the serial is connected. That is the behavior I am already seeing. It also looks like that flag is not parsed until after the The dumb-hardware lockup isn't specifically a ser2sock problem; it is related to the containerized environment. On a normal host you might expect the system to try to recover (eg a bus reset), so waiting makes sense. In the container, once it gets wedged it won't get fixed without restarting the container. If the health check works, that should be sufficient to cause a reset. |
Edit to add initial error. The first few lines are the k8s health check simply connecting and then dropping. (That happens fairly constantly without causing issues.) After that, the adapter resets (or crashes? or..?) and ser2sock transitions to error mode (accept then close) which still qualifies as healthy due to the
(repeating) |
For anyone else who hits this, turning line 572 from |
I'm running a containerized version under k8s and having a problem after device resets. It can lose connection to the underlying serial device and hang on a repeated device-not-found error. (It still answers TCP connections, which prevents the health checks from detecting the problem.)
I think an option to simply exit on errors, instead of retrying, would add a great deal of operational flexibility without affecting existing users. (This would also make it easier to work around broken hardware; for example, I've seen cheap tty adapters that requires a usb reset between attempts. If ser2sock exits on error, a simple wrapper could detect the wedged hw and reset or even power-cycle it before restarting ser2sock.)
Unfortunately everything is working this morning so I don't have log examples, but I'll keep an eye out and add them if needed.
The text was updated successfully, but these errors were encountered: