cups icon indicating copy to clipboard operation
cups copied to clipboard

Temporary queue race proposed fix

Open zdohnal opened this issue 1 year ago • 3 comments

For review regarding #871

zdohnal avatar Jan 23 '24 14:01 zdohnal

@michaelrsweet can we create points/steps what needs to be implemented/fixed to make this working? We can look into it as separate issues so make it happen one by one.

The current PR implements resetting temporary queue timer if client requests its creation, which can be one step.

zdohnal avatar Feb 01 '24 07:02 zdohnal

@zdohnal This requires a bit of thought. For starters we need to update cupsd to look for an existing queue with the same device URI. The server also needs to update the temporary queue's expiration date whenever the queue is accessed or listed (not just for print jobs) to prevent the queue from going away while a client is actively polling it.

michaelrsweet avatar Feb 02 '24 19:02 michaelrsweet

@michaelrsweet so proposal:

  • [ ] add_printer() and create_local_printer() in scheduler/ipp.c has to check existing queues on uri - if the same device URI exists and it is temporary queue, update state time of printer
  • [ ] every IPP request on the temporary queue has to update state time of printer as well.

zdohnal avatar Feb 05 '24 09:02 zdohnal

I've pushed a different change to master:

[master https://github.com/OpenPrinting/cups/commit/9383b377eba6ddb5ed80ebb244907e9be6ccd169] Update CUPS-Create-Local-Printer to preserve the existing printer based on the device URI (Issue https://github.com/OpenPrinting/cups/issues/871)

See #871 for followup reporting if the problem isn't resolved for you.

michaelrsweet avatar Mar 27 '24 18:03 michaelrsweet