Skip to content

TracePoint does not support fiber_switch (Ruby 2.3+ compatibility) #9600

Description

@rkh

Environment Information

$ mise x ruby@jruby -- ruby -v 
jruby 10.1.0.0 (4.0.0) 2026-04-20 32f988b78c OpenJDK 64-Bit Server VM 26.0.2+10-55 on 26.0.2+10-55 +indy +jit [arm64-darwin]
$ uname -a
Darwin Konstantins-MBP.localdomain 25.5.0 Darwin Kernel Version 25.5.0: Tue Jun  9 22:28:34 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6041 arm64

No other dependencies are needed to run into this issue.

I found this by tracing which thread a fiber scheduler fiber belongs to.

Expected Behavior

Should trace fiber_switch events (introduced in Ruby 2.3.0)

triggered = false

TracePoint.trace(:fiber_switch) do |tp|
  triggered = true
end

Fiber.new { p triggered }.resume

Should print true

Actual Behavior

Raises an exception:

ArgumentError: unknown event: fiber_switch
  initialize at org/jruby/ext/tracepoint/TracePoint.java:65
         new at org/jruby/RubyClass.java:1058
       trace at org/jruby/ext/tracepoint/TracePoint.java:282
      <main> at play/trace.rb:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions