-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Fix systemd notify to use a shared arena #135235
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
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @jdconrad, I've created a changelog YAML for you. |
|
||
public non-sealed interface JavaLibrary extends NativeLibrary { | ||
CloseableByteBuffer newBuffer(int len); | ||
CloseableByteBuffer newBuffer(int len, boolean shared); |
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.
instead of passing in a boolean, could we separate these two cases into two different methods? That is, have newSharedBuffer
and newConfinedBuffer
? I think this better matches the model of the jdk with ofShared()
and ofConfined
. The internal implementation can still use a flag, but the api surface area would be clearly distinct and easily understandable without remember what that flag means.
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.
Updated this.
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.
LGTM
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 really like the new newSharedBuffer
/newConfinedBuffer
and ofShared
/ofConfined
.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd.
…-dls * upstream/main: Bump FLEET_AGENTS_MAPPINGS_VERSION so the new mapping applies on upgrades (elastic#134957) [ML] Adding custom headers support openai text embeddings (elastic#134960) Fix systemd notify to use a shared arena (elastic#135235)
* Fix systemd notify to use a shared arena (#135235) CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd. * fix backport
* Fix systemd notify to use a shared arena (#135235) CloseableByteBuffer currently only uses confined Arena for buffer allocation meaning only the thread creating the Arena is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing a RuntimeException to be thrown. This changes CloseableByteBuffer to allow for a shared Arena as well for systemd. * fix backport
CloseableByteBuffer
currently only uses confinedArena
for buffer allocation meaning only the thread creating theArena
is allowed to access the native memory. When using elasticsearch with systemd, our notify-extend message is executed on a thread separate from where the native memory was allocated. This is causing aRuntimeException
to be thrown. This changesCloseableByteBuffer
to allow for a sharedArena
as well for systemd.