[
https://issues.apache.org/jira/browse/BEAM-6705?focusedWorklogId=203724&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-203724
]
ASF GitHub Bot logged work on BEAM-6705:
----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Feb/19 15:50
Start Date: 25/Feb/19 15:50
Worklog Time Spent: 10m
Work Description: reuvenlax commented on issue #7939: [BEAM-6705] Fixes
ConcurrentModificationException in RowCoderGenerator
URL: https://github.com/apache/beam/pull/7939#issuecomment-467063316
I ran into something similar, and tried to change to ConcurrentHashMap at
the time. Unfortunately I found that the change is not quite so simple,
because ConcurrentHashMap is not reentrant. In the case of nested Rows,
computeIfAbsent will recursively call generate() again, which could
deadlock everything.
I think the simplest fix to the deadlock would be to replace the recursive
call to generate() (in RowCoderGenerator::getCoder) with an instantiation
of the actual RowCoder class. RowCoder already lazily calls into
RowCoderGenerator the first time encode or decode is called, so this will
remove reentrant call from inside computeIfAbsent. Let me know if you need
some help making that change!
On Mon, Feb 25, 2019 at 6:10 AM Michal Walenia <[email protected]>
wrote:
> R: @reuvenlax <https://github.com/reuvenlax>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/beam/pull/7939#issuecomment-467024633>, or mute
> the thread
>
<https://github.com/notifications/unsubscribe-auth/AUGE1amiwNVOJkXQL0ecKvFBigB8O30wks5vQ-7dgaJpZM4bP89T>
> .
>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 203724)
Time Spent: 0.5h (was: 20m)
> ConcurrentModificationException in ParDoSchemaTest
> --------------------------------------------------
>
> Key: BEAM-6705
> URL: https://issues.apache.org/jira/browse/BEAM-6705
> Project: Beam
> Issue Type: Sub-task
> Components: runner-direct
> Reporter: Michal Walenia
> Assignee: Michal Walenia
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> When ran with Java 11, ParDoSchemaTest.testReadAndWriteMultiOutput,
> testReadAndWrite and testReadAndWriteWithSchemaRegistry
> produce ConcurrentModificationExceptions.
> This is due to change in HashMap.computeIfAbsent method specification:
> {quote}Throws:{{[ConcurrentModificationException|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ConcurrentModificationException.html]}}
> - if it is detected that the mapping function modified this map
> {quote}
> [Full documentation
> here|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#computeIfAbsent(K,java.util.function.Function)]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)