YARN-6797. TimelineWriter does not fully consume the POST response. Contributed by Jason Lowe
(cherry picked from commit 655110393b
)
This commit is contained in:
parent
ea3dba37cd
commit
401b191a3c
|
@ -151,16 +151,20 @@ public abstract class TimelineWriter implements Flushable {
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("POST to " + resURI);
|
LOG.debug("POST to " + resURI);
|
||||||
}
|
}
|
||||||
return webResource.accept(MediaType.APPLICATION_JSON)
|
ClientResponse r = webResource.accept(MediaType.APPLICATION_JSON)
|
||||||
.type(MediaType.APPLICATION_JSON)
|
.type(MediaType.APPLICATION_JSON)
|
||||||
.post(ClientResponse.class, object);
|
.post(ClientResponse.class, object);
|
||||||
|
r.bufferEntity();
|
||||||
|
return r;
|
||||||
} else if (path.equals("domain")) {
|
} else if (path.equals("domain")) {
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("PUT to " + resURI +"/" + path);
|
LOG.debug("PUT to " + resURI +"/" + path);
|
||||||
}
|
}
|
||||||
return webResource.path(path).accept(MediaType.APPLICATION_JSON)
|
ClientResponse r = webResource.path(path).accept(MediaType.APPLICATION_JSON)
|
||||||
.type(MediaType.APPLICATION_JSON)
|
.type(MediaType.APPLICATION_JSON)
|
||||||
.put(ClientResponse.class, object);
|
.put(ClientResponse.class, object);
|
||||||
|
r.bufferEntity();
|
||||||
|
return r;
|
||||||
} else {
|
} else {
|
||||||
throw new YarnRuntimeException("Unknown resource type");
|
throw new YarnRuntimeException("Unknown resource type");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue