Deadlock using AcquireFiles() Vault 2014

By Wayne Brill

There is a known issue where the AcquireFiles() function can stop responding. (This will be addressed in a future service pack). 

Here is some detail about this issue: The Vault Development Framework (VDF) needs to be initialized and told whether it is operating in the context of a UI application or not (if not specified, it will make the assumption that this *is* a UI application).  During download some of the “file reference update” extension handlers (e.g. Inventor, AutoCAD specific code) will do their work on the main UI thread (if the application is indeed a UI based application).  If the VDF thinks it is operating in the context of a UI application but it is not, (2014 JobProcessor) then you *may* (not always—it depends on whether or not file references need to be updated, and what type of file you are downloading) end up with a deadlock during AcquireFiles.

In 2013, the JobProcessor was one UI application (and thus initializing the VDF as a UI application was appropriate).  In 2014, the JobProcessor has a UI component (JobProcessor.exe) and a non-UI component (Connectivity.JobProcessor.Delegate.Host.exe).  The Connectivity.JobProcessor.Delegate.Host.exe is where the job handlers run. 

Solution:

As early as possible in your Job Handler’s implementation of IJobHandler.Execute, add the following line:
Autodesk.DataManagement.Client.Framework.Library.Initialize(false /* ui Application */);

Note: Console applications should add this line also (Under the right circumstances, it can encounter this same deadlock).


Comments

One response to “Deadlock using AcquireFiles() Vault 2014”

  1. Hi,
    I had also problems with the GetPropertyValues function from the IPropertyManager. I was running this function out from a
    process without UI. I realized that this function deadlocks in my ConsoleApplication.
    Autodesk.DataManagement.Client.Framework.Library.Initialize(false) was solving my problem.
    You explained, that calling this is not needed “always”. But could it make problems if I would call it always in my code,
    also if the process has an UI? By testing very fast, I was not able to find any side effects when calling Initialize in an UI based application.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading