Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.HashMap in computeIfAbsent #3470

Open
turbospaces opened this issue Sep 6, 2024 · 6 comments
Open

java.util.HashMap in computeIfAbsent #3470

turbospaces opened this issue Sep 6, 2024 · 6 comments

Comments

@turbospaces
Copy link

Expected behavior

From time to time getting this error in production

Actual behavior

Steps to reproduce

 java.util.HashMap in computeIfAbsent at line 1229
io.ebeaninternal.server.loadcontext.DLoadContext in manyContext at line 291
io.ebeaninternal.server.loadcontext.DLoadContext in register at line 258
io.ebeaninternal.server.loadcontext.DLoadBeanContext in register at line 45
io.ebeaninternal.server.deploy.BeanDescriptor in lazyLoadMany at line 2234
io.ebeaninternal.server.deploy.BeanDescriptor in lazyLoadMany at line 2214
io.ebeaninternal.server.loadcontext.DLoadBeanContext$LoadBuffer in loadBean at line 222
io.ebean.bean.InterceptReadWrite in loadBeanInternal at line 741
io.ebean.bean.InterceptReadWrite in loadBean at line 723
io.ebean.bean.InterceptReadWrite in preGetter at line 836
  // some logging output
@rbygrave
Copy link
Member

rbygrave commented Sep 7, 2024

Is this the full stack trace? It does not look like it. Can you include the full stack trace and the version of ebean you are using?

@rbygrave
Copy link
Member

rbygrave commented Sep 9, 2024

Can you provide the full stack trace? There isn't enough information here for this issue yet. It can't progress without more information.

@turbospaces
Copy link
Author

hi @rbygrave - the next line is production code actually, i have taken only relevant ebean elements.
It seems that there is a stream iterator in 1 to many relation with filter condition and somewhere internally once this many relation is being loaded (triggered by getter access) this error occurs. We have seen this only few times in last 2-3 months, but still it occurs from time to time

@rbygrave
Copy link
Member

rbygrave commented Sep 9, 2024

java.util.HashMap in computeIfAbsent

This isn't the actual root cause error message though.

@turbospaces
Copy link
Author

@rbygrave i have added full stack trace and replaced business logic classes/method names with XXX where needed.

java.util.HashMap in computeIfAbsent at line 1229
io.ebeaninternal.server.loadcontext.DLoadContext in manyContext at line 291
io.ebeaninternal.server.loadcontext.DLoadContext in register at line 258
io.ebeaninternal.server.loadcontext.DLoadBeanContext in register at line 45
io.ebeaninternal.server.deploy.BeanDescriptor in lazyLoadMany at line 2234
io.ebeaninternal.server.deploy.BeanDescriptor in lazyLoadMany at line 2214
io.ebeaninternal.server.loadcontext.DLoadBeanContext$LoadBuffer in loadBean at line 222
io.ebean.bean.InterceptReadWrite in loadBeanInternal at line 741
io.ebean.bean.InterceptReadWrite in loadBean at line 723
io.ebean.bean.InterceptReadWrite in preGetter at line 836
XXX in _ebean_get_XXXPolicies at line 1
XXX in findXXXPolicy at line 143
XXX in XXXModeByCurrentLocation at line 131
XXX in XXXMode at line 120
XXX in isXXXAllowed at line 294
XXX in isXXXProduct at line 287
XXX in lambda$apply$2 at line 92
java.util.stream.ReferencePipeline$2$1 in accept at line 178
java.util.Iterator in forEachRemaining at line 133
java.util.Spliterators$IteratorSpliterator in forEachRemaining at line 1939
java.util.stream.AbstractPipeline in copyInto at line 509
java.util.stream.AbstractPipeline in wrapAndCopyInto at line 499
java.util.stream.AbstractPipeline in evaluate at line 575
java.util.stream.AbstractPipeline in evaluateToArrayNode at line 260
java.util.stream.ReferencePipeline in toArray at line 616
java.util.stream.ReferencePipeline in toArray at line 622
java.util.stream.ReferencePipeline in toList at line 627
XXX in apply at line 104
XXX in run at line 167
XXX in run at line 26
XXX in run at line 71
com.google.common.util.concurrent.SequentialExecutor$1 in run at line 126
com.google.common.util.concurrent.SequentialExecutor$QueueWorker in workOnQueue at line 240
com.google.common.util.concurrent.SequentialExecutor$QueueWorker in run at line 184
java.util.concurrent.ThreadPoolExecutor in runWorker at line 1144
java.util.concurrent.ThreadPoolExecutor$Worker in run at line 642
java.lang.Thread in run at line 1583

@jnehlmeier
Copy link

The error is a ConcurrentModificationException. Is it a parallel stream that potentially has the same entity in the list multiple times and thus processes it concurrently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants