Autodesk Design Automation Inventor超时关闭及不稳定问题咨询
Autodesk Design Automation API插件超时问题排查求助
我基于Autodesk Design Automation API开发的插件已稳定运行2年,近期突然出现服务器超时错误导致任务失败。错误发生在保存输出文件的最后一步,即使是500KB的小文件,仅执行打开和保存操作(未启用HeartBeat函数)也会触发,相关日志如下:
[01/11/2023 14:55:28] display name input.iam [01/11/2023 14:55:28] doc type kAssemblyDocumentObject [01/11/2023 14:55:28] docdir C:\Users\acesworker\Documents\Inventor Server x64 SDK [01/11/2023 14:55:28] InventorCoreConsole.exe Information: 0 : Generate drawing document [01/11/2023 14:55:28] InventorCoreConsole.exe Information: 0 : Create a new drawing document [01/11/2023 14:55:28] InventorCoreConsole.exe Information: 0 : Get or create a new drawing sheet [01/11/2023 14:55:28] InventorCoreConsole.exe Information: 0 : Create a base view [01/11/2023 14:55:33] InventorCoreConsole.exe Information: 0 : Change scale of base drawing view [01/11/2023 14:55:33] InventorCoreConsole.exe Information: 0 : Create projected view [01/11/2023 14:55:33] InventorCoreConsole.exe Information: 0 : Create part list [01/11/2023 14:55:35] InventorCoreConsole.exe Information: 0 : Create Revision table [01/11/2023 14:55:35] InventorCoreConsole.exe Information: 0 : Done:Create Revision table [01/11/2023 14:55:35] InventorCoreConsole.exe Information: 0 : Saving IDW C:\Users\acesworker\Documents\Inventor Server x64 SDK\input.idw [01/11/2023 14:56:36] Error: Inventor Core Engine Core Console is shut down due to timeout. [01/11/2023 14:56:36] End script phase. [01/11/2023 14:56:36] Error: An unexpected error happened during phase CoreEngineExecution of job. [01/11/2023 14:56:36] Job finished with result FailedExecution [01/11/2023 14:56:36] Job Status:
后续清理了ActivityIds、AppIds等配置,插件有时能成功执行,但偶尔需要重试3次以上,甚至仍会失败,运行日志如下:
Create workitem 21/03/2023 12:54:19 : Workitem id: 11d07facf3ed4cff926a7c70425cc6aa 21/03/2023 12:54:21 : Work item status : inprogress ... 21/03/2023 12:55:42 : Work item status : inprogress 21/03/2023 12:55:44 : Work item status : failedInstructions 21/03/2023 12:55:52 : Create workitem 21/03/2023 12:55:53 : Workitem id: 210e2c7b8f2f4922be9a7e33cb29e947 21/03/2023 12:55:55 : Work item status : inprogress 21/03/2023 12:55:57 : Work item status : inprogress ... 21/03/2023 12:57:32 : Work item status : inprogress 21/03/2023 12:57:34 : Work item status : success
排查思路与解决方案
- 启用HeartBeat机制:即使是简单的打开保存操作,添加HeartBeat函数,每30秒发送一次心跳信号,避免Design Automation因判定任务无响应而超时终止。
- 检查Inventor Server版本兼容性:Autodesk可能更新了服务器端Inventor Server版本,确认插件依赖版本与当前环境是否一致,必要时调整插件适配最新版本。
- 优化文件保存逻辑:
- 保存前关闭所有不必要的文档视图、隐性对话框,释放占用资源。
- 改用
SaveAs方法并指定明确的路径和格式参数,替代默认Save操作,避免参数异常引发阻塞。
- 排查集群资源波动:任务偶尔成功说明非代码逻辑问题,可能是Design Automation集群临时资源不足。可在不同时段提交任务观察成功率,或联系Autodesk确认集群状态。
- 清理缓存与释放资源:除ActivityIds、AppIds外,清理任务临时文件、缓存;插件执行结束后,用
Marshal.ReleaseComObject正确释放所有Inventor对象,避免资源泄漏影响后续任务。 - 添加智能重试机制:客户端针对
failedInstructions和超时错误,设置1-2分钟的重试间隔,避免短时间重复提交加重集群负载。 - 细化保存阶段日志:在插件中添加保存过程的细粒度日志,记录文件写入进度、资源占用情况,定位阻塞环节。
内容的提问来源于stack exchange,提问作者Juan Ruiz
相关产品推荐
相关产品推荐

