YARN-3594. WintuilsProcessStubExecutor.startStreamReader leaks streams. Contributed by Lars Francke.
This commit is contained in:
parent
0c6638c2ea
commit
132d909d4a
@ -256,6 +256,9 @@ Release 2.8.0 - UNRELEASED
|
|||||||
YARN-3684. Changed ContainerExecutor's primary lifecycle methods to use a more
|
YARN-3684. Changed ContainerExecutor's primary lifecycle methods to use a more
|
||||||
extensible mechanism of context objects. (Sidharta Seethana via vinodkv)
|
extensible mechanism of context objects. (Sidharta Seethana via vinodkv)
|
||||||
|
|
||||||
|
YARN-3594. WintuilsProcessStubExecutor.startStreamReader leaks streams.
|
||||||
|
(Lars Francke via junping_du)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
YARN-3339. TestDockerContainerExecutor should pull a single image and not
|
YARN-3339. TestDockerContainerExecutor should pull a single image and not
|
||||||
|
@ -501,17 +501,14 @@ private Thread startStreamReader(final InputStream stream)
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try
|
try (BufferedReader lines = new BufferedReader(
|
||||||
{
|
new InputStreamReader(stream, Charset.forName("UTF-8")))) {
|
||||||
BufferedReader lines = new BufferedReader(
|
|
||||||
new InputStreamReader(stream, Charset.forName("UTF-8")));
|
|
||||||
char[] buf = new char[512];
|
char[] buf = new char[512];
|
||||||
int nRead;
|
int nRead;
|
||||||
while ((nRead = lines.read(buf, 0, buf.length)) > 0) {
|
while ((nRead = lines.read(buf, 0, buf.length)) > 0) {
|
||||||
output.append(buf, 0, nRead);
|
output.append(buf, 0, nRead);
|
||||||
}
|
}
|
||||||
}
|
} catch (Throwable t) {
|
||||||
catch(Throwable t) {
|
|
||||||
LOG.error("Error occured reading the process stdout", t);
|
LOG.error("Error occured reading the process stdout", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user