apache / apache/druid

Structural search inspection: incorrect try-finally locking pattern

Open
#8,158 0 comments 0 reactions 0 assignees View on GitHub
Area - Automation/Static Analysis Contributions Welcome
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

This [structural search pattern](https://github.com/apache/incubator-druid/blob/master/dev/teamcity.md#creating-a-custom-inspection-from-a-structural-search-pattern):
```
try {
$x$.lock();
$Statement$;
}
```
Where `$Statement$` has `Count` filter from 0 to "unlimited", allows to catch bad locking patterns, first noticed by @clintropolis here: https://github.com/apache/incubator-druid/pull/7547/files#r294553352

Contributor guide

Open the contributing guide

Research direction

Start with dev/teamcity.md and the structural search pattern shown in the issue, then review the referenced discussion in PR 7547. Determine what locking pattern the inspection should identify and update the inspection guidance or pattern so that the intended bad pattern is detected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.