-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Unlink delegate in ReleasableBytesReference once ref count reaches 0 #127058
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
Changes from 3 commits
257494e
1a32b71
2fd23a1
d97f3be
e09ceed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,6 @@ | |
| import static org.elasticsearch.xpack.remotecluster.AbstractRemoteClusterSecurityTestCase.performRequestWithAdminUser; | ||
| import static org.hamcrest.Matchers.arrayContaining; | ||
| import static org.hamcrest.Matchers.containsString; | ||
| import static org.hamcrest.Matchers.equalTo; | ||
| import static org.hamcrest.Matchers.greaterThanOrEqualTo; | ||
| import static org.hamcrest.Matchers.hasSize; | ||
| import static org.hamcrest.Matchers.instanceOf; | ||
|
|
@@ -282,7 +281,7 @@ public void testIndicesPrivilegesAreEnforcedForCcrRestoreSessionActions() throws | |
| GetCcrRestoreFileChunkAction.REMOTE_TYPE, | ||
| new GetCcrRestoreFileChunkRequest(response2.getNode(), sessionUUID2, leaderIndex2FileName, 1, shardId2) | ||
| ); | ||
| assertThat(getChunkResponse.getChunk().length(), equalTo(1)); | ||
| assertFalse(getChunkResponse.getChunk().hasReferences()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh this is pretty much exactly what this is about :P this assertion shouldn't have worked but worked as long as we didn't check for having a reference in the |
||
|
|
||
| // Clear restore session fails if index is unauthorized | ||
| final var e4 = expectThrows( | ||
|
|
||
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.
We could just check
refCounted.hasReferences()again, no need to checkhasRefright?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 got this idea into my head that we might be introducing far more happens-before into everything than necessary via assertions and that as a result reproducing some prod bugs isn't happening. But on reflection, it doesn't make too much sense to do so here, a false
hasRefread twice should actually never introduce a happens before, I'll clean it up before merging :)