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
lpstat hangs with stopped cupsd on Solaris #5833
Comments
lpstat was terminated by ^C. |
This is an interresting part of truss:
Firstly I don't understand why httpConnect2 is called with blocking=1 and the argument is not used in the underlying functions while they do unconditional nonblocking connect. If this is an intention, than there is a missing mechanism to check the state of the socket before it is being polled. Maybe getsockopt() is what would 'workaround' the issue though I am in doubt that is the right fix here. I assume it works accidentally on linux as the non blocking connec() operation finishes sooner that poll() is called. Still the check should be there as far as I understand. Could you advise, please? |
Here is the patch which consider a socket on which getsockopt() fails as non connected on Solaris. Though I still don't understand some details of httpAddrConnect2() behavior this change makes Solaris
Could I ask you to rework the patch and integrate it in current cups, please? |
Please report this to the OpenPrinting CUPS project. The code in httpConnect2 is there to support multi-homing. That is, when a server (or printer) is available on multiple addresses, the client may not be able to determine which address is best. So httpConnect2 uses a non-blocking connect to try each address in parallel, stopping only once a connection is made. It sounds like the Solaris networking stack isn't propagating the error as it should, which is why your proposed patch fixes things on Solaris. We'll need to test this on multiple platforms to ensure this doesn't cause a regression. |
There is an issue with cups client time out on Solaris. If I stop cupsd or use -h localhost:632 for lpstat it does not fail even if there is no daemon listening and hangs.
$ lpstat -h localhost:632
I have rebuilt the cups with debug enabled and tried again to generate more debug info. This is the interesting part of it:
Even if there is nothing listening on [::1]:632, it thinks it is connected and continues trying with re-connect. Could you look into it and guess what is wrong there, please?
Complete debug log attached.
The text was updated successfully, but these errors were encountered: