【发布时间】:2021-09-07 11:14:31
【问题描述】:
由于文件锁定超时,我在 Windows 10 机器上的项目突然停止并行运行。
我所有的项目都在使用 gradle-wrapper 并提供一个run 任务
当我启动第一个运行任务时,它正常工作,但任何后续运行任务都会出现如下错误:
> .\gradlew run
Starting a Gradle Daemon, 1 busy and 4 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal().
> Timeout waiting to lock journal cache (C:\Users\injec\.gradle\caches\journal-1). It is currently in use by another Gradle instance.
Owner PID: 16440
Our PID: 12216
Owner Operation:
Our operation:
Lock file: C:\Users\injec\.gradle\caches\journal-1\journal-1.lock
--status 选项显示:
> .\gradlew --status
PID STATUS INFO
12216 IDLE 6.9.1
16440 BUSY 6.9.1
14992 STOPPED (stop command received)
7856 STOPPED (other compatible daemons were started and after being idle for 0 minutes and not recently used)
26680 STOPPED (by user or operating system)
18556 STOPPED (by user or operating system)
我尝试了不同的技巧,例如切换 Gradle 版本 5.6.1 - 6.8.3 - 6.9.1 并使用 --stop 选项,但错误仍然存在。
将--stacktrace 添加到运行命令表明不仅涉及journal-1 缓存,还涉及其他一些目录,例如modules-2。
除了定期更新 Win10 之外,我没有对我的系统进行任何更改。
如何解决问题?
TIA
【问题讨论】:
-
你有没有机会用提升的 shell(powershell with run-as-admin)启动一些 gradle 实例?
-
否,在默认用户权限下。通常我直接从eclipse开始