Denis Chudov created IGNITE-28310:
-------------------------------------

             Summary: ClientInboundMessageHandler#writeError may cause 
significant GC pressure in case of multiple exceptions
                 Key: IGNITE-28310
                 URL: https://issues.apache.org/jira/browse/IGNITE-28310
             Project: Ignite
          Issue Type: Bug
            Reporter: Denis Chudov


In case of multiple exceptions, writeError causes massive memory allocations, 
creating GC pressure and provoking further degradation.

Some samples:
 
{code:java}
Stack Trace Count   Percentage void java.lang.Thread.run() 1   100 % void 
java.lang.Thread.runWith(Object, Runnable) 1   100 % void 
java.util.concurrent.ThreadPoolExecutor$Worker.run()   1   100 % void 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)   
1   100 % void java.util.concurrent.CompletableFuture$Completion.run()    1   
100 % CompletableFuture 
java.util.concurrent.CompletableFuture$UniHandle.tryFire(int) 1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture.postFire(CompletableFuture, int)   1   
100 % void java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext$$Lambda.0x00000008011dbcc0.accept(Object,
 Object)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.lambda$performFinish$1(Throwable,
 Void, Throwable)  1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.completeFinishInProgressFuture(boolean,
 Throwable, Throwable)   1   100 % boolean 
java.util.concurrent.CompletableFuture.complete(Object) 1   100 % void 
java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler$$Lambda.0x0000000801086e20.accept(Object,
 Object) 1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.lambda$processOperationInternal$12(long,
 int, ChannelHandlerContext, HybridTimestampTracker, ResponseWriter, Object)  1 
  100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeError(long, 
int, Throwable, ChannelHandlerContext, boolean)  1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeErrorCore(Throwable,
 ClientMessagePacker)    1   100 % String 
org.apache.ignite.internal.util.ExceptionUtils.getFullStackTrace(Throwable)  1  
 100 % List 
org.apache.ignite.internal.util.ExceptionUtils.getThrowableList(Throwable) 1   
100 % Throwable 
org.apache.ignite.internal.util.ExceptionUtils.getCause(Throwable)    1   100 % 
Throwable org.apache.ignite.internal.util.ExceptionUtils.getCause(Throwable, 
String[])  1   100 % Throwable 
org.apache.ignite.internal.util.ExceptionUtils.getCauseUsingMethodName(Throwable,
 String) 1   100 % Method java.lang.Class.getMethod(String, Class[])   1   100 
% void java.lang.NoSuchMethodException.<init>(String) 1   100 % void 
java.lang.ReflectiveOperationException.<init>(String)  1   100 % void 
java.lang.Exception.<init>(String) 1   100 % void 
java.lang.Throwable.<init>(String) 1   100 % Throwable 
java.lang.Throwable.fillInStackTrace()    1   100 % Throwable 
java.lang.Throwable.fillInStackTrace(int) 1   100 %{code}
 606 MiB.
 
Also,
 
{code:java}
Stack Trace Count   Percentage void java.lang.Thread.run() 1   100 % void 
java.lang.Thread.runWith(Object, Runnable) 1   100 % void 
java.util.concurrent.ThreadPoolExecutor$Worker.run()   1   100 % void 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)   
1   100 % void java.util.concurrent.CompletableFuture$Completion.run()    1   
100 % CompletableFuture 
java.util.concurrent.CompletableFuture$UniHandle.tryFire(int) 1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture.postFire(CompletableFuture, int)   1   
100 % void java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext$$Lambda.0x00000008011dbcc0.accept(Object,
 Object)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.lambda$performFinish$1(Throwable,
 Void, Throwable)  1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.completeFinishInProgressFuture(boolean,
 Throwable, Throwable)   1   100 % boolean 
java.util.concurrent.CompletableFuture.complete(Object) 1   100 % void 
java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler$$Lambda.0x0000000801086e20.accept(Object,
 Object) 1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.lambda$processOperationInternal$12(long,
 int, ChannelHandlerContext, HybridTimestampTracker, ResponseWriter, Object)  1 
  100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeError(long, 
int, Throwable, ChannelHandlerContext, boolean)  1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeErrorCore(Throwable,
 ClientMessagePacker)    1   100 % String 
org.apache.ignite.internal.util.ExceptionUtils.getFullStackTrace(Throwable)  1  
 100 % boolean 
org.apache.ignite.internal.util.ExceptionUtils.isNestedThrowable(Throwable) 1   
100 % Method java.lang.Class.getMethod(String, Class[])   1   100 % String 
java.lang.Class.methodToString(String, Class[])  1   100 % StringBuilder 
java.lang.StringBuilder.append(char)  1   100 % AbstractStringBuilder 
java.lang.AbstractStringBuilder.append(char)  1   100 % void 
java.lang.AbstractStringBuilder.ensureCapacityInternal(int)    1   100 % byte[] 
java.util.Arrays.copyOf(byte[], int) 1   100 %{code}
 
and more
 
{code:java}
Stack Trace Count   Percentage void java.lang.Thread.run() 1   100 % void 
java.lang.Thread.runWith(Object, Runnable) 1   100 % void 
java.util.concurrent.ThreadPoolExecutor$Worker.run()   1   100 % void 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)   
1   100 % void java.util.concurrent.CompletableFuture$Completion.run()    1   
100 % CompletableFuture 
java.util.concurrent.CompletableFuture$UniHandle.tryFire(int) 1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture.postFire(CompletableFuture, int)   1   
100 % void java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext$$Lambda.0x00000008011dbcc0.accept(Object,
 Object)   1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.lambda$performFinish$1(Throwable,
 Void, Throwable)  1   100 % void 
org.apache.ignite.internal.tx.impl.TransactionInflights$ReadWriteTxContext.completeFinishInProgressFuture(boolean,
 Throwable, Throwable)   1   100 % boolean 
java.util.concurrent.CompletableFuture.complete(Object) 1   100 % void 
java.util.concurrent.CompletableFuture.postComplete()  1   100 % 
CompletableFuture 
java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(int)   1   100 % 
boolean java.util.concurrent.CompletableFuture.uniWhenComplete(Object, 
BiConsumer, CompletableFuture$UniWhenComplete)   1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler$$Lambda.0x0000000801086e20.accept(Object,
 Object) 1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.lambda$processOperationInternal$12(long,
 int, ChannelHandlerContext, HybridTimestampTracker, ResponseWriter, Object)  1 
  100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeError(long, 
int, Throwable, ChannelHandlerContext, boolean)  1   100 % void 
org.apache.ignite.client.handler.ClientInboundMessageHandler.writeErrorCore(Throwable,
 ClientMessagePacker)    1   100 % String 
org.apache.ignite.internal.util.ExceptionUtils.getFullStackTrace(Throwable)  1  
 100 % List 
org.apache.ignite.internal.util.ExceptionUtils.getThrowableList(Throwable) 1   
100 % Throwable 
org.apache.ignite.internal.util.ExceptionUtils.getCause(Throwable)    1   100 % 
Throwable org.apache.ignite.internal.util.ExceptionUtils.getCause(Throwable, 
String[])  1   100 % Throwable 
org.apache.ignite.internal.util.ExceptionUtils.getCauseUsingMethodName(Throwable,
 String) 1   100 % Method java.lang.Class.getMethod(String, Class[])   1   100 
% String java.lang.Class.methodToString(String, Class[])  1   100 % Object 
java.util.stream.ReferencePipeline.collect(Collector)    1   100 % Object 
java.util.stream.AbstractPipeline.evaluate(TerminalOp)   1   100 % Object 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(PipelineHelper, 
Spliterator)  1   100 % Sink 
java.util.stream.AbstractPipeline.wrapAndCopyInto(Sink, Spliterator)   1   100 
% void java.util.stream.AbstractPipeline.copyInto(Sink, Spliterator)  1   100 % 
void java.util.Spliterators$ArraySpliterator.forEachRemaining(Consumer) 1   100 
% void java.util.stream.ReferencePipeline$3$1.accept(Object)  1   100 % void 
java.util.stream.ReduceOps$3ReducingSink.accept(Object)    1   100 % void 
java.util.stream.Collectors$$Lambda.0x00000008001222e8.accept(Object, Object)  
1   100 % StringJoiner java.util.StringJoiner.add(CharSequence)   1   100 
%{code}
 
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to