Skip to content

Conversation

@jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Apr 18, 2025

I noticed a failure on one of my PRs that indicated that we were missing a parameters for a Strings.format() call. This PR fixes that. I started writing a unit test but gave up because of how much I'd need to mock 😬

Example failure

WARNING: Uncaught exception in thread: Thread[#127,elasticsearch[node_s_0][system_write][T#1],5,TGRP-ModelRegistryTests]
java.lang.AssertionError: Exception thrown when formatting [Failed to rollback while handling failure to update inference endpoint [%s]. Endpoint may be in an inconsistent state due to [%s]]. java.util.MissingFormatArgumentException. Format specifier '%s'
	at __randomizedtesting.SeedInfo.seed([2AA8A84ED211FFB]:0)
	at org.elasticsearch.core.Strings.format(Strings.java:32)
	at org.elasticsearch.xpack.inference.registry.ModelRegistry.lambda$updateModelTransaction$17(ModelRegistry.java:605)
	at org.elasticsearch.action.ActionListenerImplementations$ResponseWrappingActionListener.onResponse(ActionListenerImplementations.java:261)
	at org.elasticsearch.action.support.SubscribableListener$SuccessResult.complete(SubscribableListener.java:394)
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:314)
	at org.elasticsearch.action.support.SubscribableListener.setResult(SubscribableListener.java:343)
	at org.elasticsearch.action.support.SubscribableListener.onResponse(SubscribableListener.java:250)
	at org.elasticsearch.action.ActionListenerImplementations$DelegatingResponseActionListener.onResponse(ActionListenerImplementations.java:198)
	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:33)
	at org.elasticsearch.action.ActionListener$3.onResponse(ActionListener.java:413)
	at org.elasticsearch.tasks.TaskManager$1.onResponse(TaskManager.java:203)
	at org.elasticsearch.tasks.TaskManager$1.onResponse(TaskManager.java:197)
	at org.elasticsearch.action.ActionListenerImplementations$RunBeforeActionListener.onResponse(ActionListenerImplementations.java:350)
	at org.elasticsearch.action.ActionListener$3.onResponse(ActionListener.java:413)
	at org.elasticsearch.action.ActionListenerImplementations$RunBeforeActionListener.onResponse(ActionListenerImplementations.java:350)
	at org.elasticsearch.action.ActionListener$3.onResponse(ActionListener.java:413)
	at org.elasticsearch.action.bulk.BulkOperation.completeBulkOperation(BulkOperation.java:434)
	at org.elasticsearch.action.bulk.BulkOperation.redirectFailuresOrCompleteBulkOperation(BulkOperation.java:429)
	at org.elasticsearch.action.bulk.BulkOperation.executeBulkRequestsByShard(BulkOperation.java:393)
	at org.elasticsearch.action.bulk.BulkOperation.doRun(BulkOperation.java:195)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
	at org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(TransportBulkAction.java:621)
	at org.elasticsearch.action.bulk.TransportBulkAction$1.doRun(TransportBulkAction.java:398)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
	at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:34)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1044)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)
	at java.base/java.lang.Thread.run(Thread.java:1447)

@jonathan-buttner jonathan-buttner added >non-issue :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 v8.17.6 labels Apr 18, 2025
@jonathan-buttner jonathan-buttner marked this pull request as ready for review April 21, 2025 14:12
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@jonathan-buttner jonathan-buttner merged commit e840334 into elastic:main Apr 21, 2025
17 checks passed
jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 21, 2025
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0
8.17

jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 21, 2025
jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 21, 2025
jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 21, 2025
elasticsearchmachine pushed a commit that referenced this pull request Apr 21, 2025
elasticsearchmachine pushed a commit that referenced this pull request Apr 21, 2025
elasticsearchmachine pushed a commit that referenced this pull request Apr 21, 2025
elasticsearchmachine pushed a commit that referenced this pull request Apr 21, 2025
@jonathan-buttner jonathan-buttner deleted the ml-fix-update-string-format branch April 21, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :ml Machine learning >non-issue Team:ML Meta label for the ML team v8.17.6 v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants