-
Notifications
You must be signed in to change notification settings - Fork 374
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
CELEBORN-1079: Fix use of GuardedBy in client-flink/common #2029
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2029 +/- ##
=======================================
Coverage 46.90% 46.90%
=======================================
Files 165 165
Lines 10531 10531
Branches 959 959
=======================================
Hits 4938 4938
Misses 5271 5271
Partials 322 322 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -92,7 +90,6 @@ public class PartitionSortedBuffer implements SortBuffer { | |||
// For writing | |||
// --------------------------------------------------------------------------------------------- | |||
/** Whether this sort buffer is released. A released sort buffer can not be used. */ | |||
@GuardedBy("lock") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming this GuardedBy
is a holdover from some past migration ?
This class is marked as not thread safe, and there is no lock
instance.
Given this, I removed the annotation
@@ -155,6 +155,7 @@ public void recycle(ByteBuffer buffer) { | |||
} | |||
} | |||
|
|||
@GuardedBy("lock") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a assert Thread.holdsLock(lock)
- so the expectation is that these two methods have the lock
held.
This annotation is is to help error prone understand that entire method is marked thread safe w.r.t lock
* Fix use of `GuardedBy` on nonexistant lock. * Annotate methods, which are expected to be called with lock held, with `GuardedBy` so that error prone can analyze all invocations There is no functional change, but it helps errorprone analysis. No Unit tests Closes apache#2029 from mridulm/fix-flink-guarded-by-annotation. Authored-by: Mridul Muralidharan <mridulatgmail.com> Signed-off-by: zky.zhoukeyong <[email protected]>
What changes were proposed in this pull request?
GuardedBy
on nonexistant lock.GuardedBy
so that error prone can analyze all invocationsWhy are the changes needed?
There is no functional change, but it helps errorprone analysis.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit tests