Skip to content

Commit 56735c6

Browse files
author
Max Hniebergall
committed
remove debug logs
1 parent 6e3db61 commit 56735c6

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rest/ServerSentEventsRestActionListener.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -336,47 +336,39 @@ public ReleasableBytesReference encodeChunk(int sizeHint, Recycler<BytesRef> rec
336336
assert target == null;
337337
target = chunkStream;
338338

339-
logger.warn("encodeChunk1");
340339
// if this is the first time we are encoding this chunk, write the SSE leading bytes
341340
if (isStartOfData.compareAndSet(true, false)) {
342341
target.write(ServerSentEventSpec.BOM);
343342
target.write(event.eventType);
344343
target.write(ServerSentEventSpec.EOL);
345344
target.write(ServerSentEventSpec.DATA);
346-
logger.warn("encodeChunk2");
347345
}
348346

349347
// start or continue writing this chunk
350348
while (serialization.hasNext()) {
351-
logger.warn("encodeChunk3");
352349
serialization.next().toXContent(builder, params);
353-
logger.warn("encodeChunk4");
354350
if (chunkStream.size() >= sizeHint) {
355351
break;
356352
}
357353
}
358-
logger.warn("encodeChunk5");
359354

360355
if (serialization.hasNext() == false) {
361-
logger.warn("encodeChunk6");
362356
// SSE wants two newlines between messages
363357
builder.close();
364358
target.write(ServerSentEventSpec.EOL);
365359
target.write(ServerSentEventSpec.EOL);
366360
target.flush();
367-
logger.warn("encodeChunk7");
368361

369362
}
370363
final var result = new ReleasableBytesReference(chunkStream.bytes(), () -> Releasables.closeExpectNoException(chunkStream));
371-
logger.warn("encodeChunk8");
372364
target = null;
373365
return result;
374366
} catch (Exception e) {
375-
logger.error("failure encoding chunk 1", e);
367+
logger.error("failure encoding chunk", e);
376368
throw e;
377369
} finally {
378370
if (target != null) {
379-
assert false : "failure encoding chunk 2";
371+
assert false : "failure encoding chunk";
380372
IOUtils.closeWhileHandlingException(target);
381373
target = null;
382374
}
@@ -436,11 +428,11 @@ public ReleasableBytesReference encodeChunk(int sizeHint, Recycler<BytesRef> rec
436428
isPartComplete = true;
437429
return new ReleasableBytesReference(chunkStream.bytes(), () -> Releasables.closeExpectNoException(chunkStream));
438430
} catch (Exception e) {
439-
logger.error("failure encoding chunk 3", e);
431+
logger.error("failure encoding chunk", e);
440432
throw e;
441433
} finally {
442434
if (isPartComplete == false) {
443-
assert false : "failure encoding chunk 4";
435+
assert false : "failure encoding chunk";
444436
IOUtils.closeWhileHandlingException(chunkStream);
445437
}
446438
}

0 commit comments

Comments
 (0)