Skip to content

Backport bump jruby 9.4.13#19188

Open
andsel wants to merge 16 commits into
elastic:8.19from
andsel:backport_bump_jruby_9.4.13
Open

Backport bump jruby 9.4.13#19188
andsel wants to merge 16 commits into
elastic:8.19from
andsel:backport_bump_jruby_9.4.13

Conversation

@andsel

@andsel andsel commented Jun 4, 2026

Copy link
Copy Markdown
Member

Release notes

Update jruby to 9.4.13.0 #19188

What does this PR do?

Backports #17787 and #17696 to bundle JRuby 9.4.13 to Logstahs 8.19 branch, fixing conflicts.

Why is it important/What is the impact to the user?

Updates bundled JRuby to a more recent version.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues


How to review

56 files of the 77 are NOTICE files or the license mapping CSV file.
Of the remaining changed files are mostly updates from the original PR, except:

  1. the usage of run_command_in_path instead of run_sudo_command_in_path because the method is not present.
  2. the lockfile regeneration

I've left some comments highlighting these places.

@andsel andsel self-assigned this Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

donoghuc and others added 8 commits June 5, 2026 09:43
* upgrade jruby to 9.4.11.0

* follow up cleanups

* follow up cleanups

* follow up cleanups

* follow up cleanups

* add licenses

* Update rakelib/plugins-metadata.json

* attempt to fix rubygems

* attempt to fix rubygems

* attempt to fix rubygems

* tweaks for jruby 9.4.12.0 and sha256 validation

* attempt at fixing rubygems

* attempt at fixing rubygems

* attempt at fixing rubygems

* attempt at fixing rubygems

* Bump jruby to 9.4.12.1

* Explicitly require 'set' to make `to_set` available

Something appears to have changed in code loading where this require
is no longer in the call chain. Explicitly require it here.

* Fix up dependency mapper

* Update bundler code with latest rubygems release

This commit makes 2 changes:

1. We were sending a `Gem::Platform` instance to Thor parser instead of a
string. Convert to string version of a platform name. With newly added checks in
Thor, we were getting `noMethodError` for `Gem::Platform`.

2.  It looks like there was a patch to get around a bug in bundler that was
reaching out to the network for local gems. This appears to have been fixed
upstream, this removes the patch.

* Restore patch

* Remove patch (TODO, link to full writeup)

* SPIKE: Take up jruby 9.4.13.0

* Patch bundler cache

Still validating this. Essentially ensure we check local gems when calling cache using
the updated rubygems class.

* WIP: test patch for acceptance tests

* Skip when unable to cache

* Cache every gem

* Fix acceptance test

* Force another route through builtin

* Fixup idea (it returns nil, not raise)

* Fix missing version update

* Fix qatest filter plugin

Without including a gemspec with a locally built gem logstash-plugin list
will not show it in the output.

* Use vendored gem instead of reaching out to rubygems

We vendor an udpated test gem for local install. Use that instead of
reaching out to rubygems.

* Document and comment on the patched bundler code

* Fix test

instead of downloading the "broken" one from rubygems (downloading the `.gem` file directly
does show up in plugin-list), using a vendored one polutes the cache. Use a new vendored
gem

---------

Co-authored-by: João Duarte <jsvduarte@gmail.com>
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Without this change the Bundler shipped with JRuby 9.4.13 (2.6.3) checks the
existing lockfile version (2.3.26), given the mismatching version, Bundler tries
to restarts itself but with half backed configuration, not setting a HOME properly
and makes failing the `:bootstrap`.

./gradlew bootstrap runs Bundler inside Gradle’s embedded JRuby (jruby-core), not via vendor/jruby/bin/jruby. Because that embedded runtime has no JRuby home set, Gem.ruby points to a non-existent $TMPDIR/bin/jruby, and when Bundler tries to auto-switch to the lockfile’s Bundler version (2.3.26 vs 2.6.3), it fails with Errno::ENOENT trying to exec that path.
* Pin jar-dependencies to match jruby 9.4.13.0

When default and bundler dont agree we can see errors about activated versions.

* Revert "fix jars installer for new maven and pin psych to 5.2.2 (elastic#16919)"

This reverts commit 52b7fb0.
@andsel andsel force-pushed the backport_bump_jruby_9.4.13 branch from 79fdc60 to 116e076 Compare June 5, 2026 08:14
@andsel

andsel commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

run exhaustive tests

@andsel

andsel commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

run exhaustive tests

@andsel andsel marked this pull request as ready for review June 16, 2026 07:23
Comment thread qa/acceptance/spec/shared_examples/cli/logstash-plugin/install.rb
Comment thread .updatecli-version Outdated
Comment thread rubyUtils.gradle
Comment thread Gemfile.template
Comment thread lib/bootstrap/bundler.rb
Comment thread logstash-core/logstash-core.gemspec
andsel and others added 2 commits June 19, 2026 09:32
Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
@andsel andsel requested a review from yaauie June 19, 2026 08:56
Comment thread logstash-core/logstash-core.gemspec Outdated
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

The failed Ruby, X-Pack unit, and X-Pack integration jobs all have the same root cause: i18n is required during Logstash bootstrap but this PR removes logstash-core's runtime dependency declaration for it. Restore the i18n dependency in logstash-core/logstash-core.gemspec and refresh the bundle/lock artifacts as needed.

Remediation

  • Re-add gem.add_runtime_dependency "i18n", "~> 1" #(MIT license) to logstash-core/logstash-core.gemspec in the core runtime dependency block.
  • Regenerate the JRuby 3.1 bundle/lock artifacts if the build expects them to be committed, then validate with ./gradlew rubyTests :logstash-xpack:rubyTests :logstash-xpack:rubyIntegrationTests --console=plain.
Investigation details

Root Cause

This is a dependency/configuration regression introduced by the PR. The PR diff for logstash-core/logstash-core.gemspec removes the runtime dependency line:

@@ -62,14 +62,9 @@ Gem::Specification.new do |gem|
   gem.add_runtime_dependency "treetop", "~> 1" #(MIT license)
 
-  gem.add_runtime_dependency "i18n", "~> 1" #(MIT license)
-
   gem.add_runtime_dependency "thwait"

But Logstash still requires i18n during bootstrap. The failed jobs reach logstash-core/lib/logstash/settings.rb, which does require "i18n", and JRuby cannot load it.

Evidence

org.logstash.xpack.test.RSpecTests > rspecTests FAILED
org.jruby.exceptions.LoadError: (LoadError) no such file to load -- i18n
    at RUBY.<main>(.../logstash-core/lib/logstash/settings.rb:24)
    at RUBY.<main>(.../logstash-core/lib/logstash/environment.rb:20)
    at RUBY.<main>(.../lib/bootstrap/rspec.rb:21)

The X-Pack integration log has the same stack at settings.rb:24, and the Ruby unit-test log reports 43 failures with the same repeated LoadError: no such file to load -- i18n root cause.

No existing flaky-test issue matched "no such file to load -- i18n", and this failure happens before specs execute, so retrying will not address it.

Verification

Not run locally; the local checkout is not this PR branch. The diagnosis is based on the Buildkite logs plus the PR diff showing the removed runtime dependency.


What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@andsel andsel force-pushed the backport_bump_jruby_9.4.13 branch from d6b5c16 to 5ea4d35 Compare June 23, 2026 07:05
@andsel

andsel commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

run exhaustive tests

@andsel andsel requested a review from donoghuc June 23, 2026 09:13
@donoghuc donoghuc self-assigned this Jun 23, 2026

@donoghuc donoghuc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall:
For the most part this looks correct, though I do have a question below that is gating an approval. I focused mainly on manual testing the pluginmanager (as this was the hardest part to get working when i worked on the original 9.x upgrade). Everything seems to be in order there! I did find #19235 but that is not related to this work.

Change request
Can you double check or walk me through the updates to the Gemfile.jruby-3.1.lock.release? It seems like there are some test/dev deps that have slipped in. How was this generated/modified?

When i tried locally I came up with this diff (against what you have):

diff --git a/Gemfile.jruby-3.1.lock.release b/Gemfile.jruby-3.1.lock.release
index 3a46e2453..ced91b3ca 100644
--- a/Gemfile.jruby-3.1.lock.release
+++ b/Gemfile.jruby-3.1.lock.release
@@ -104,7 +104,6 @@ GEM
     dalli (3.2.8)
     date (3.3.3-java)
     diff-lcs (1.6.2)
-    digest-crc (0.5.1)
     docile (1.4.1)
     domain_name (0.6.20240107)
     dotenv (2.8.1)
@@ -146,20 +145,11 @@ GEM
       pleaserun (~> 0.0.29)
       rexml
       stud
-    ftw (0.0.49)
-      addressable (>= 2.4)
-      backports (>= 2.6.2)
-      cabin (> 0)
-      http_parser.rb (~> 0.6)
-    gelf (3.1.0)
-      json
     gelfd2 (0.4.1)
     gem_publisher (1.5.0)
     gems (1.3.0)
     gene_pool (1.5.0)
       concurrent-ruby (>= 1.0)
-    gmetric (0.1.3)
-    gserver (0.0.1)
     hashdiff (1.2.1)
     hitimes (1.3.1-java)
     http (3.3.0)
@@ -773,13 +763,8 @@ GEM
       rack (>= 3.0.0)
     rack-test (2.2.0)
       rack (>= 1.3)
-    rackup (2.0.0)
-      rack (>= 3)
-      webrick
     rainbow (3.1.1)
     rake (13.4.2)
-    random-port (0.8.0)
-      tago (~> 0.0)
     redis (4.8.1)
     regexp_parser (2.12.0)
     reline (0.6.3)
@@ -789,8 +774,6 @@ GEM
       rspec-core (~> 3.13.0)
       rspec-expectations (~> 3.13.0)
       rspec-mocks (~> 3.13.0)
-    rspec-collection_matchers (1.2.1)
-      rspec-expectations (>= 2.99.0.beta1)
     rspec-core (3.13.6)
       rspec-support (~> 3.13.0)
     rspec-expectations (3.13.5)
@@ -799,9 +782,6 @@ GEM
     rspec-mocks (3.13.8)
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.13.0)
-    rspec-sequencing (0.1.1)
-      concurrent-ruby
-      rspec (>= 3.0.0)
     rspec-support (3.13.7)
     rspec-wait (1.0.2)
       rspec (>= 3.4)
@@ -818,14 +798,10 @@ GEM
       unicode-display_width (>= 2.4.0, < 4.0)
     rubocop-ast (1.42.0)
       parser (>= 3.3.7.2)
-    ruby-kafka (1.5.0)
-      digest-crc
     ruby-progressbar (1.13.0)
     rubyzip (1.3.0)
     rufus-scheduler (3.0.9)
       tzinfo
-    rumbster (1.1.0)
-      mail
     sawyer (0.9.3)
       addressable (>= 2.3.5)
       faraday (>= 0.17.3, < 3)
@@ -850,18 +826,13 @@ GEM
       rack-protection (= 4.2.1)
       rack-session (>= 2.0.0, < 3)
       tilt (~> 2.0)
-    snappy (0.5.1-java)
-      snappy-jars (~> 1.1.0)
-    snappy-jars (1.1.0.1.2-java)
     spoon (0.0.6)
       ffi
     stud (0.0.23)
-    tago (0.7.0)
     thread_safe (0.3.6-java)
     thwait (0.2.0)
       e2mmap
     tilt (2.7.0)
-    timecop (0.9.11)
     timeout (0.6.1)
     treetop (1.6.18)
       polyglot (~> 0.3)
@@ -890,7 +861,6 @@ GEM
       addressable (>= 2.8.0)
       crack (>= 0.3.2)
       hashdiff (>= 0.4.0, < 2.0.0)
-    webrick (1.9.2)
     xml-simple (1.1.9)
       rexml

@@ -901,26 +871,18 @@ DEPENDENCIES
   belzebuth
   benchmark-ips
   bigdecimal (~> 3.1)
-  cabin (~> 0.6)
   cgi (~> 0.3.7)
-  childprocess
+  childprocess (~> 4)
   ci_reporter_rspec (~> 1)
   date (= 3.3.3)
-  digest-crc (~> 0.5.1)
-  elasticsearch
   fileutils (~> 1.7)
   flores (~> 0.0.8)
   fpm (~> 1, >= 1.14.1)
-  ftw (~> 0.0.42)
-  gelf (= 3.1.0)
   gems (~> 1)
-  gmetric
-  gserver
-  insist
   jar-dependencies (= 0.5.4)
   json-schema (~> 2)
   logstash-codec-avro (~> 3.4)
-  logstash-codec-cef
+  logstash-codec-cef (~> 6.2)
   logstash-codec-collectd (~> 3.1)
   logstash-codec-dots (~> 3.0)
   logstash-codec-edn (~> 3.1)
@@ -1018,41 +980,26 @@ DEPENDENCIES
   logstash-output-tcp (~> 6.2)
   logstash-output-udp (~> 3.2)
   logstash-output-webhdfs (~> 3.1)
-  logstash-patterns-core
-  manticore
   minitar (~> 1)
   murmurhash3 (= 0.1.6)
   octokit (~> 4.25)
   paquet (~> 0.2)
   pleaserun (~> 0.0.28)
   polyglot
-  pry
   rack-test
-  rackup (< 2.1.0)
   rake (~> 13)
-  random-port
-  rspec
-  rspec-collection_matchers
-  rspec-sequencing
-  rspec-wait
+  rspec (~> 3.5)
   rubocop
   rubocop-ast (= 1.42.0)
-  ruby-kafka
   ruby-progressbar (~> 1)
   rubyzip (~> 1)
-  rufus-scheduler (~> 3.0.9)
-  rumbster
   simplecov (~> 0.22.0)
   simplecov-json
-  sinatra
-  snappy
-  stud
+  stud (~> 0.0.22)
   thwait
-  timecop
   treetop
   uri (~> 0.12.3)
-  webmock
-  webrick
+  webmock (~> 3)

 BUNDLED WITH
    2.6.3

@donoghuc donoghuc removed their assignment Jun 23, 2026
@andsel

andsel commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

It was regenerated with commands:

rm Gemfile.lock
./gradlew clean installDefaultGems
cp Gemfile.lock Gemfile.jruby-3.1.lock.release

In commit 387eb08. Then I spotted that many plugins were resolved to newer minor version, so limit the surface of changes I rolled back the changes on plugin versions in 493fdbb. I think these are leftover of that upgrade and rollback some versions.

The idea is, in this step, to reduce the surface of changes to plugins, that will be a followup update on the a next version bump. For example in this PR I don't want to switch elasticsearch client from 8.18.1 to 8.19.3.

@andsel andsel requested a review from donoghuc June 24, 2026 15:57
@donoghuc

Copy link
Copy Markdown
Member

run exhaustive tests

@donoghuc donoghuc self-assigned this Jun 24, 2026
@donoghuc

donoghuc commented Jun 24, 2026

Copy link
Copy Markdown
Member

I would like to experiment with updating the lockfile such that we only take up minor bumps for gems when required. I see some bumps that i'm not convinced are strictly necessary. I would like to investigate and come up with a robust/repeatable way to generate the lock file to minimize the change set.

I have assigned myself this PR and will work on this asap.

donoghuc added 2 commits June 25, 2026 13:38
Bring the JRuby 9.4.13 backport up to date with the latest 8.19 (puma 8.x, 8.19.18, i18n pin revert, ERB/jwt lock updates).
…nse artifacts

psych pin 5.2.2 -> 5.2.3 to match the gem JRuby 9.4.13 ships by default (the only lock<default mismatch; otherwise Bundler.setup raises an activation conflict). Regenerate NOTICE.TXT and restore the JRuby stdlib entries in licenseMapping.csv that the 8.19 merge had dropped. No third-party gem version changes beyond what the JRuby bump requires.
@donoghuc donoghuc changed the base branch from logstash_8.19_jruby10 to 8.19 June 25, 2026 20:46
@donoghuc

Copy link
Copy Markdown
Member

run exhaustive tests

@donoghuc

Copy link
Copy Markdown
Member

UDPATES:

  • I wanted to find a way to minimize the gem set change here (IE this is still a "patch" level logstash, therefore prioritize "patch" level gem updates). I have found the minimal set of gem changes that are required solely for the jruby update and nothing else.
  • I have refreshed to 8.19 and re-targeted the PR to 8.19 as we will want to land it there.

NOTES:

You may be wondering why there are so many license additions: This is because the default set of gems shipped with jruby changed. This requires additions/updates to the license mapping workflows.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @andsel @donoghuc

@donoghuc donoghuc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With minimal gem set and passing exhaustive/PR tests I think this is G2G. Will wait for a proper release cycle point for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants