Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lock path computation on Windows and minor simplifications #2426

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

HannesWell
Copy link
Member

Fixes #2423

import java.io.OutputStream;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +528 to +532
try {
return Path.of(URIUtil.toURI(workspaceUrl)).resolve(LOCK_INFO_FILE);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. this reminded me of a work that I started a while ago and that I have now made a draft in Equinox:

When that's available this could be further simplified to (but at the moment this is not possible yet!):

Suggested change
try {
return Path.of(URIUtil.toURI(workspaceUrl)).resolve(LOCK_INFO_FILE);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
return URIUtil.toFilePath(workspaceUrl).resolve(LOCK_INFO_FILE);

Copy link
Contributor

Test Results

 1 818 files  ±0   1 818 suites  ±0   1h 44m 27s ⏱️ - 2m 3s
 7 711 tests ±0   7 482 ✅ +3  228 💤 ±0  1 ❌  - 3 
24 294 runs  ±0  23 546 ✅ +3  747 💤 ±0  1 ❌  - 3 

For more details on these failures, see this check.

Results for commit 710b70e. ± Comparison against base commit 2ebbbe9.

@iloveeclipse
Copy link
Member

Failed test is unrelated and caused by eclipse-platform/eclipse.platform#1592:

java.util.concurrent.ExecutionException: java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker
	at java.base/java.util.concurrent.ForkJoinTask.reportExecutionException(ForkJoinTask.java:605)
	at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:981)
	at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:335)
	at org.eclipse.core.internal.filesystem.local.LocalFile.lambda$2(LocalFile.java:325)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker
	at java.base/java.util.concurrent.ForkJoinPool.tryCompensate(ForkJoinPool.java:1819)
	at java.base/java.util.concurrent.ForkJoinPool.helpJoin(ForkJoinPool.java:1852)
	at java.base/java.util.concurrent.ForkJoinTask.awaitDone(ForkJoinTask.java:440)
	at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:979)
	at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:335)
	at org.eclipse.core.internal.filesystem.local.LocalFile.lambda$2(LocalFile.java:325)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinTask.awaitDone(ForkJoinTask.java:436)
	at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:979)
	... 8 more

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, checked on Windows, works now.

@iloveeclipse iloveeclipse merged commit 9f38380 into eclipse-platform:master Oct 21, 2024
12 of 17 checks passed
@HannesWell HannesWell deleted the fix-2423 branch October 21, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not write lock info file
3 participants