Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3d586f8
Extra logging to files for JvmWorker/ZincWorker
arturaz Aug 13, 2025
352fa72
WIP: cleaning up stream pumpers.
arturaz Aug 13, 2025
9758861
Things seem to work.
arturaz Aug 13, 2025
9dbb65b
Things seem to work for real now.
arturaz Aug 14, 2025
014acbc
Merge remote-tracking branch 'upstream/main' into fix/5693-zinc-worke…
arturaz Aug 14, 2025
f9ae7e4
WIP
arturaz Aug 14, 2025
2db6ef7
WIP: debugging
arturaz Aug 14, 2025
f19bad6
JvmWorkerImpl: a version without pumpers
arturaz Aug 14, 2025
aafd0b6
move code
arturaz Aug 14, 2025
ca69b6c
Remove stream debugging.
arturaz Aug 14, 2025
63a79ec
Optimize imports.
arturaz Aug 14, 2025
1257817
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 14, 2025
1b6c4f6
Update golden tests.
arturaz Aug 17, 2025
fdd3543
binary compatibility
arturaz Aug 17, 2025
b860b24
Make `Timed` `private[mill]`
arturaz Aug 17, 2025
75ba990
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 17, 2025
56534b7
Minimized version.
arturaz Aug 17, 2025
82cad20
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 17, 2025
559a39f
Updated tests.
arturaz Aug 18, 2025
a3e34e5
Fix.
arturaz Aug 18, 2025
f8b7184
Merge branch 'fix/rapid-startup-shutdown' into fix/5693-zinc-worker-p…
arturaz Aug 18, 2025
bfa08c3
Update tests.
arturaz Aug 18, 2025
9535ae9
Merge remote-tracking branch 'upstream/main' into fix/5693-zinc-worke…
arturaz Aug 18, 2025
1cdada1
Merge remote-tracking branch 'upstream/main' into fix/5693-zinc-worke…
arturaz Aug 18, 2025
dd7b47b
Merge remote-tracking branch 'upstream/main' into fix/5693-zinc-worke…
arturaz Aug 18, 2025
14a2986
Improvements.
arturaz Aug 18, 2025
b3bb068
Comments.
arturaz Aug 18, 2025
7da332c
Merge branch 'fix/5693-zinc-worker-performance-regression-minimized' …
arturaz Aug 18, 2025
65086d2
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 18, 2025
98a598a
Fix compilation on JDK 11.
arturaz Aug 18, 2025
3cf6d4e
Merge branch 'fix/5693-zinc-worker-performance-regression-minimized' …
arturaz Aug 18, 2025
d058814
Merge branch 'fix/5693-zinc-worker-performance-regression-minimized' …
arturaz Aug 18, 2025
c454e2f
Merge remote-tracking branch 'upstream/main' into fix/5693-zinc-worke…
arturaz Aug 18, 2025
fbf3c3e
PR updates.
arturaz Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions core/constants/src/mill/constants/InputPumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.io.OutputStream;
import java.util.function.Supplier;

/// A `Runnable` that reads from `src` and writes to `dest`.
/** A `Runnable` that reads from `src` and writes to `dest`. */
public class InputPumper implements Runnable {
private final Supplier<InputStream> src0;
private final Supplier<OutputStream> dest0;
Expand All @@ -15,7 +15,7 @@ public class InputPumper implements Runnable {
/// and there is nothing to read, [it can unnecessarily delay the JVM exit by 350ms](
///
// https://stackoverflow.com/questions/48951611/blocking-on-stdin-makes-java-process-take-350ms-more-to-exit)
private final Boolean checkAvailable;
private final boolean checkAvailable;

public InputPumper(
Supplier<InputStream> src, Supplier<OutputStream> dest, Boolean checkAvailable) {
Expand All @@ -28,29 +28,29 @@ public InputPumper(

@Override
public void run() {
InputStream src = src0.get();
OutputStream dest = dest0.get();
var src = src0.get();
var dest = dest0.get();

byte[] buffer = new byte[1024];
var buffer = new byte[1024 /* 1kb */];
try {
while (running) {
if (checkAvailable && src.available() == 0)
//noinspection BusyWait
Thread.sleep(1);
else {
int n;
int bytesRead;
try {
n = src.read(buffer);
bytesRead = src.read(buffer);
} catch (Exception e) {
n = -1;
bytesRead = -1;
}
if (n == -1) running = false;
else if (n == 0)
if (bytesRead == -1) running = false;
else if (bytesRead == 0)
//noinspection BusyWait
Thread.sleep(1);
else {
try {
dest.write(buffer, 0, n);
dest.write(buffer, 0, bytesRead);
dest.flush();
} catch (java.io.IOException e) {
running = false;
Expand Down
Loading
Loading