Concurrent::ScheduledTask is broken on master JRuby #4407

Closed
kirs opened this Issue Dec 22, 2016 · 4 comments

Projects

None yet

3 participants

@kirs
Contributor
kirs commented Dec 22, 2016

I'm running latest version of concurrent-ruby (1.0.3) and JRuby master.

require 'concurrent'
class Job
  def perform
    puts "ddd"
  end
end

job = Job.new
executor = Concurrent::ImmediateExecutor.new
Concurrent::ScheduledTask.execute(10, args: [job], executor: executor, &:perform)

The last line crashes with java.lang.NoSuchFieldError: SUPPORTS_FENCES (full stacktrace)

The same snippet works fine on jruby-9.1.6.0, so I believe there is a regression in 9.1.7 / master.

@headius

@olleolleolle
Contributor
olleolleolle commented Dec 22, 2016 edited

This commit removed SUPPORTS_FENCES: Remove unsafe block from build altogether 64b9553

And concurrent-ruby relies on that field: concurrent-ruby code using that field in its Java/JRuby extension

What's the new/preferred way forward for concurrent-ruby, now that this field is gone?

Can they use UnsafeFences.SUPPORTS_FENCES instead?

ruby-concurrency/concurrent-ruby@7b03abb This commit added the current solution to concurrent-ruby

@headius
Member
headius commented Dec 23, 2016

Ahh I was worried about someone using those fields or methods. I will restore and deprecate the field.

@headius headius closed this in 993395f Dec 23, 2016
@headius headius added this to the JRuby 9.1.7.0 milestone Dec 23, 2016
@headius
Member
headius commented Dec 23, 2016

This should be fixed on master. Please confirm!

@kirs
Contributor
kirs commented Dec 24, 2016

Thanks for fixing it! I confirm that it works.

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