-
Notifications
You must be signed in to change notification settings - Fork 194
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
Yarpserver get stuck if it reads a string with a single " #1542
Comments
Somehow related to #1508. I think we should sanitize the port names in general 😅 |
I will let the students answer this, in particular @marco-monforte and @anqingd that work in the iCub Facility. |
Hi @traversaro @Nicogene. I had a look at the history of our cursed .xml file. Here goes the snippet:
Unfortunately, we only saw one of the two If I don't remember incorrectly, yarpmanager was freezing as soon as the modules in the app were run. I guess that this behaviour might be straightforward to reproduce at least, with the code in our repository. Apart from the |
Hi guys and sorry for replying only now, but I traveled all the day yesterday. Anyway, as @ericpairet said, the problem was the apexes in the port name. This should be easily repeatable from one of the last commits (or maybe even from the last, if Eric didn't change the error 😜). We can have a look together at IIT on Monday or as soon as you are available. |
My hope was that it was a yard::os::NetworkBase::exists("\"notExistingPort") it get stuck. So I would move this issue as a |
Digging into the yarp::os::Bottle cmd, reply, event;
bool ok = cmd.read(reader); where I think that the problem is in the parsing in |
Probably I found the solution of the mystery 🕵️♂️
In this case the string with only one The only way to fix it is to check the inputs before sending requests to the |
Does yarpserver get stuck if it receives such a string? |
With @damn1 and @drdanz we found a possible solution: delegate->getInputStream().setReadTimeout(1.0);
delegate->getOutputStream().setWriteTimeout(1.0); inside In this way if you put only one With this fix
Any suggestions for better fixes ? |
Doable for me @Nicogene 👍 Anyway, is there any room for unexpected behaviors? In other words, is there at the moment any case where the connection may stay freezed for slightly more than 1 second and then restored soon afterward (e.g. very overloaded network due to complicated demos)? |
I suggest to add a "--timeout" option (setting default 1.0) to yarpserver |
The command line option is worthy, but I would make up a more meaningful name than just |
uhm, timeouts lead to the dark side... |
Timeouts are an anti-pattern I know, but sometimes they're the only way out. |
Setting a unique timeout on the yarpserver may be a limitation, but we could do it and see if it works out. |
At vvv18, one team had several different problems when a xml application file was malformed because it contained a
"
in the port name in theconnection
tag:or in
dependencies
tag:The problems seems to be both at the yarpmanager level ( that was freezing ) @Nicogene and at the yarpserver level, that was behaving in a strange way when queryed with a port name like
"/module/port1
@drdanz . A possible solution could be to sanitize port names loaded from the application file, as soon as possible.cc @marco-monforte @atabakd @JuanMiguelAlvarez @ericpairet @anqingd @raedbsili1991 please provide any additional details that could be useful to avoid this problem in the future, thanks!
The text was updated successfully, but these errors were encountered: