cups icon indicating copy to clipboard operation
cups copied to clipboard

[WIP] Parallel timeout for fetching PPD files.

Open pranjanpr opened this issue 5 years ago • 4 comments

Issue https://github.com/OpenPrinting/cups/issues/65 When some of the PPD generators took more then 60 seconds to get PPD files then cups expires the scheduler.

To solve the issue, created a separate thread along with the main thread. Main thread waits for the timeout and the separate thread calls cupsFileGets() to get the PPD files. If it is not able to fetch it within timeout, the main thread terminates the separate thread.

@zdohnal @michaelrsweet Please review it. Thanks !

pranjanpr avatar Feb 26 '21 20:02 pranjanpr

This doesn't appear to do what we need it to do.

In order for this change to work, we need to run the driver interface programs in the background (in separate threads, or just poll'ing with the cupsFileNumber's which might be simpler and it will be easier to time them out together) and then limit the total amount of time they can run...

Okay so the idea is to divide the ppd generators into different available threads and use poll.h (instead of pthread which I have done currently) in every thread such that it does not exceed timeout. I will first try to implement poll.h as it would be universal in every scenario such as when the CPU won't be having multiple threads.

pranjanpr avatar Feb 28 '21 05:02 pranjanpr

@michaelrsweet SIr, I have added poll.h and removed the former pthread.h for creating timeout for PPD descriptors. Please review it. Thanks !

pranjanpr avatar Mar 03 '21 11:03 pranjanpr

Hi @pranjanpr ,

any updates regarding implementing what Mike has requested?

zdohnal avatar Oct 27 '21 04:10 zdohnal

Hi, I didn't have any progress since the last commit.

pranjanpr avatar Oct 27 '21 10:10 pranjanpr

The original issue is closed, so the enhancement is no longer required.

Thank you for the PR nevertheless!

zdohnal avatar May 31 '23 10:05 zdohnal