-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[ML] Possible race condition between multiple memoryTracker.isRecentlyRefreshed() calls #69289
Comments
Pinging @elastic/ml-core (Team:ML) |
droberts195
added a commit
that referenced
this issue
Feb 19, 2021
This change fixes a race condition that can occur if the return value of memoryTracker.isRecentlyRefreshed() changes between two calls that are assumed to return the same value. The solution is to just call the method once and pass that value to the other place where it is needed. Then all related code makes decisions based on the same view of whether the memory tracker has been recently refreshed or not. Fixes #69289
droberts195
added a commit
that referenced
this issue
Feb 22, 2021
This change fixes a race condition that can occur if the return value of memoryTracker.isRecentlyRefreshed() changes between two calls that are assumed to return the same value. The solution is to just call the method once and pass that value to the other place where it is needed. Then all related code makes decisions based on the same view of whether the memory tracker has been recently refreshed or not. Fixes #69289
droberts195
added a commit
that referenced
this issue
Feb 22, 2021
This change fixes a race condition that can occur if the return value of memoryTracker.isRecentlyRefreshed() changes between two calls that are assumed to return the same value. The solution is to just call the method once and pass that value to the other place where it is needed. Then all related code makes decisions based on the same view of whether the memory tracker has been recently refreshed or not. Fixes #69289
droberts195
added a commit
that referenced
this issue
Feb 22, 2021
This change fixes a race condition that can occur if the return value of memoryTracker.isRecentlyRefreshed() changes between two calls that are assumed to return the same value. The solution is to just call the method once and pass that value to the other place where it is needed. Then all related code makes decisions based on the same view of whether the memory tracker has been recently refreshed or not. Fixes #69289
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While triaging #69276 I noticed a different problem that could theoretically be affecting production use of ML.
The master node log contains this section:
It implies that two calls to
memoryTracker.isRecentlyRefreshed()
in different parts of the code which are assumed to return the same value actually returned different values (false
inSnapshotUpgradeTaskExecutor.getAssignment
andtrue
inAbstractJobPersistentTasksExecutor.checkMemoryFreshness
).The effect of unnecessarily falling back to assigning jobs by count rather than memory is bad because it could lead to ML native processes suffering OOM errors if memory is constrained.
The text was updated successfully, but these errors were encountered: