RFR: 8335231: [macos] Test java/awt/print/PrinterJob/Cancel/PrinterJobCancel.java failed on macOS because the case didn't get the expected PrintAbortException [v3]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Aug 1 05:15:30 UTC 2024
On Wed, 31 Jul 2024 18:48:01 GMT, Phil Race <prr at openjdk.org> wrote:
>> I dont see any deadlock in my testing so I am using `isCancelled` .
>> How do you normally "cancel" ongoing printing in macosx? I tried clicking on "x" in "Print Centre" when the specific print job is shown in the printer spooler and I dont see any deadlock for long printing tests like PrintAllFonts etc..
>
> plugin mode is no longer a concern.
>
> So it seems to me that the worry is that some other thread holds the lock on the PrinterJob, and
> is waiting for a print loop to return from native code running on the AppKit thread, which then up-calls to here and then needs to synchronize on the PrinterJob.
> Other cases that I see aren't from native so aren't a problem.
>
> "Coming to your question, I guess if there is a deadlock, calling cancelDoc directly will also face the same"
>
> Yes whereas In the existing code it is run on the AppKit thread to avoid it ...
> It seems safest to restore the invokeLater.
Ok..Restore invokeLater and handled/thrown PrinterAbortException in native..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20027#discussion_r1699431986
More information about the client-libs-dev
mailing list