apache / apache/gravitino

[Improvement] Possible threading issue in BaseCatalog.java, BasePropertiesMetadata.java, BaseTable.java and sqlSessionFactory.java

Open
#3,032 0 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 15h
Merged PRs (30d)
315

Description

### What would you like to be improved?

The fields ops, capability, and properties are marked as volatile. However, doing this is not enough to make the code thread safe as those types are not thread-safe.

The same issue exists for propertyEntries in BasePropertiesMetadata.java, ops in BaseTable.java and sqlSessionFactory in sqlSessionFactory.java.

### How should we improve?

Make the code thread safe.

Contributor guide

Open the contributing guide

Research direction

Start by reading BaseCatalog.java, BasePropertiesMetadata.java, BaseTable.java, and sqlSessionFactory.java, focusing on the volatile fields ops, capability, properties, propertyEntries, and sqlSessionFactory and how they are accessed. Trace their mutable types and concurrent call paths before deciding what thread-safety guarantees are required. Done means these accesses are safe under concurrent use, with tests covering the identified races.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.