USB backend never ends if the printer is not connected. we have been able to identify a infinity loop in print_device function in usb-libusb.c file:
```
fprintf(stderr, "DEBUG: Printing on printer with URI: %s\n", uri);
while ((g.printer = find_device(print_cb, uri)) == NULL)
{
_cupsLangPrintFilter(stderr, "INFO",
_("Waiting for printer to become available."));
sleep(5);
}
```
It's also easy to test by invoking the backend by hand:
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 159 quirks.
DEBUG: Printing on printer with URI: usb://Brother/PJ-773?serial=?
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_get_device_list=6
INFO: Waiting for printer to become available.
...
```
Setting a job timeout policy or stopping the job by hand are not options for us. We can have job that take up to an hour to complete.
USB backend never ends if the printer is not connected. we have been able to identify a infinity loop in print_device function in usb-libusb.c file:
``` print_cb, uri)) == NULL) intFilter( stderr, "INFO",
fprintf(stderr, "DEBUG: Printing on printer with URI: %s\n", uri);
while ((g.printer = find_device(
{
_cupsLangPr
_("Waiting for printer to become available."));
sleep(5);
}
```
It's also easy to test by invoking the backend by hand:
``` URI='usb: //Printer/ Model?serial= ?' cups/backend/ usb 0 root title 1 '' data.file
# export DEVICE_
# /usr/lib/
DEBUG: Loading USB quirks from "/usr/share/ cups/usb" . PJ-773? serial= ? get_device_ list=6
DEBUG: Loaded 159 quirks.
DEBUG: Printing on printer with URI: usb://Brother/
DEBUG: libusb_
INFO: Waiting for printer to become available.
DEBUG: libusb_ get_device_ list=6 get_device_ list=6 get_device_ list=6 get_device_ list=6
INFO: Waiting for printer to become available.
DEBUG: libusb_
INFO: Waiting for printer to become available.
DEBUG: libusb_
INFO: Waiting for printer to become available.
DEBUG: libusb_
INFO: Waiting for printer to become available.
...
```
Setting a job timeout policy or stopping the job by hand are not options for us. We can have job that take up to an hour to complete.