Skip to content
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

Send jobs to an unplugged usb printer on linux increases cpu usage #2769

Closed
michaelrsweet opened this issue Mar 25, 2008 · 2 comments
Closed
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.3.6
CUPS.org User: salem

If you send a job to an unplugged usb printer on linux, the process called usb takes 100% of cpu usage.
It happens, as far as I can see, due to an infinite loop in usb-unix.c.
If no device returns EBUSY, sleep() is never called.
The attached patch fixes this issue here. Please, check if it can be applied upstream and if there are no side-effects.

Thank you

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"cups-1.3.6-disconnected-usb-increases-cpu-usage.patch":

diff -p -up cups-1.3.6/backend/usb-unix.c.org cups-1.3.6/backend/usb-unix.c
--- cups-1.3.6/backend/usb-unix.c.org 2008-03-25 10:39:46.000000000 -0300
+++ cups-1.3.6/backend/usb-unix.c 2008-03-25 10:40:20.000000000 -0300
@@ -417,8 +417,8 @@ open_device(const char uri, / I - Dev
{
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 5 seconds...\n"));

  • sleep(5);
    }
  •  sleep(5);
    
    }
    }
    #elif defined(__sun) && defined(ECPPIOC_GETDEVID)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant