mythrocks commented on a change in pull request #807:
URL: https://github.com/apache/hive/pull/807#discussion_r434739477
##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
##########
@@ -51,20 +51,19 @@ public Instance retrieve(SeedObject hv) throws
AvroSerdeException {
* Retrieve (or create if it doesn't exist) the correct Instance for this
* SeedObject using 'seenSchemas' to resolve circular references
*/
- public synchronized Instance retrieve(SeedObject hv,
- Set<SeedObject> seenSchemas) throws AvroSerdeException {
+ public Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas)
+ throws AvroSerdeException {
if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString());
if(cache.containsKey(hv)) {
Review comment:
I had left [a comment about this on
HIVE-19261](https://issues.apache.org/jira/browse/HIVE-19261?focusedCommentId=16929610&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16929610).
I think `makeInstance()` makes reentrant calls into
`InstanceCache::retrieve()`.
`computeIfAbsent()` expects that `cache` not be modified in the lambda.
Calling calling `makeInstance()` from `computeIfAbsent()` might lead to a
hang. I ran into this when testing an older version of this patch, some months
ago.
It's possible that the reentrant call no longer occurs. I'd check this
before using `computeIfAbsent()`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]