Skip to content
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

Concurrent::ScheduledTask is broken on master JRuby #4407

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

Concurrent::ScheduledTask is broken on master JRuby #4407

kirs opened this issue Dec 22, 2016 · 4 comments
Milestone

Comments

@kirs
Copy link
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
Copy link
Member

olleolleolle commented Dec 22, 2016

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
Copy link
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 added this to the JRuby 9.1.7.0 milestone Dec 23, 2016
@headius
Copy link
Member

headius commented Dec 23, 2016

This should be fixed on master. Please confirm!

@kirs
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants