hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

EntityId cache lookup for evmAddress/Alias can throw Recursive Update Exception

Open edwin-greene opened this issue 1 year ago • 0 comments

Description

The evm address and alias cacheLookup method in EntityIdServiceImpl can result in a recursive update exception.

Here is the exception from testnet:

2024-08-15 13:12:22.988	2024-08-15T18:12:22.988Z ERROR pool-11-thread-2 c.h.m.i.util.Utility Recoverable error. Invalid itemizedTransfer entity id at 1723745537096530003 
2024-08-15 13:12:22.988	2024-08-15T18:12:22.984Z ERROR pool-11-thread-2 c.h.m.i.util.Utility Recoverable error. Error looking up alias or EVM address <ByteString@54cf70ae size=35 contents=":!\003\223\026\203\210G\273W\t\027\276Jl\001\373\362O\214\301$\211(\331\a/\257\362\345\272\n\315\363\200"> from cache org.springframework.cache.Cache$ValueRetrievalException: Value for key '<ByteString@54cf70ae size=35 contents=":!\003\223\026\203\210G\273W\t\027\276Jl\001\373\362O\214\301$\211(\331\a/\257\362\345\272\n\315\363\200">' could not be loaded using 'com.hedera.mirror.importer.domain.EntityIdServiceImpl$$Lambda/0x00007be33d42fc18@4e88d541'
	at org.springframework.cache.caffeine.CaffeineCache$LoadFunction.apply(CaffeineCache.java:240)
	at com.github.benmanes.caffeine.cache.LocalCache.lambda$statsAware$2(LocalCache.java:167)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2688)
	at java.base/java.util.concurrent.ConcurrentHashMap.compute(Unknown Source)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669)
	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
	at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
	at org.springframework.cache.caffeine.CaffeineCache.get(CaffeineCache.java:135)
	at com.hedera.mirror.importer.domain.EntityIdServiceImpl.cacheLookup(EntityIdServiceImpl.java:121)
	at com.hedera.mirror.importer.domain.EntityIdServiceImpl.lookup(EntityIdServiceImpl.java:67)
	at com.hedera.mirror.importer.parser.record.entity.EntityRecordItemListener.processItemizedTransfers(EntityRecordItemListener.java:240)
	at com.hedera.mirror.importer.parser.record.entity.EntityRecordItemListener.onItem(EntityRecordItemListener.java:150)
	at com.hedera.mirror.importer.parser.record.entity.EntityRecordItemListener.onItem(EntityRecordItemListener.java:77)
	at com.hedera.mirror.importer.parser.record.RecordFileParser.lambda$doParse$0(RecordFileParser.java:174)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at com.hedera.mirror.importer.parser.record.RecordFileParser.doParse(RecordFileParser.java:166)
	at com.hedera.mirror.importer.parser.record.RecordFileParser.doParse(RecordFileParser.java:52)
	at com.hedera.mirror.importer.parser.AbstractStreamFileParser.parse(AbstractStreamFileParser.java:104)
	at com.hedera.mirror.importer.parser.record.RecordFileParser.parse(RecordFileParser.java:127)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:379)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:92)
	at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:344)
	at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:233)
	at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:113)
	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:162)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
	at com.hedera.mirror.importer.parser.record.RecordFileParser$$SpringCGLIB$$0.parse(<generated>)
	at com.hedera.mirror.importer.downloader.BatchStreamFileNotifier$StreamFileSubscriber.handle(BatchStreamFileNotifier.java:134)
	at com.hedera.mirror.importer.downloader.BatchStreamFileNotifier$StreamFileSubscriber.run(BatchStreamFileNotifier.java:107)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Recursive update
	at java.base/java.util.concurrent.ConcurrentHashMap.transfer(Unknown Source)
	at java.base/java.util.concurrent.ConcurrentHashMap.addCount(Unknown Source)
	at java.base/java.util.concurrent.ConcurrentHashMap.compute(Unknown Source)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2686)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2669)
	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:112)
	at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
	at org.springframework.cache.caffeine.CaffeineCache.get(CaffeineCache.java:135)
	at com.hedera.mirror.importer.domain.EntityIdServiceImpl.findByPublicKeyAlias(EntityIdServiceImpl.java:207)
	at com.hedera.mirror.importer.domain.EntityIdServiceImpl.lambda$lookup$0(EntityIdServiceImpl.java:71)
	at org.springframework.cache.caffeine.CaffeineCache$LoadFunction.apply(CaffeineCache.java:237)
	... 43 common frames omitted

Steps to reproduce

  1. Ingest the record stream from that consensus timestamp from testnet.

Additional context

No response

Hedera network

testnet

Version

v.0.111.0

Operating system

None

edwin-greene avatar Aug 15 '24 20:08 edwin-greene