<opt_abel>
I just upgraded from JRuby 9.0.0.0 rc2 to 9.1.6.0 and I'm getting a fixnum error.
<chrisseaton>
opt_abel: can you Gist a stack trace?
<opt_abel>
I'm having trouble tracing the problem since the trace that's printed just points to a file in the concurrent-ruby gem.
<chrisseaton>
Ah well we know about concurrent-ruby as well :)
<opt_abel>
Yeah you helped me over a year ago with it.
<opt_abel>
Let me upgrade to the latest concurrent gem and get you a line number. It has to do with me calling a future and referencing its value.
<opt_abel>
Well now with JRuby 9.1.6.0 and concurrent-ruby 1.0.2, it's not giving me the fixnum error, just that I'm now apparently referencing an object with a nil value rather than an enumerable like my code expects.
<opt_abel>
So I'm pushing futures onto an array while calling .execute on them immediately before pushing. Then immediately pulling each future off of the list and evaluating its results. The future.value should be an array of objects, but it's returning nil.
<opt_abel>
Has futures behavior changed between concurrent-ruby 0.9.0 and 1.0.2 that I need to read up on?
<opt_abel>
My thread pool should be allocated, and dumping my array of futures indicates that one is immediately getting processed while the others are pending. But the next line iterates over the futures array, and the first call to the first future's value returns nil. Not an array with a nil object, but as if the future failed entirely.
dido has joined #jruby
<opt_abel>
On http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Future.html I see, "A timeout value can be passed to #value to limit how long the call will block. If nil the call will block indefinitely. If 0 the call will not block. Any other integer or float value will indicate the maximum number of seconds to block."
<opt_abel>
What is the syntax to pass this to my future? Is it an arg I can pass to it upon construction or do I need to call something before I request its value?
<chrisseaton>
.value(n)
<opt_abel>
That was it!
<opt_abel>
Thank you so much. The default timeout must have changed between infinite blocking and a set timeout.
<opt_abel>
False alarm. I hadn't updated my path to the newest JRuby/gem. The futures are still failing.
<opt_abel>
Upon inspection I can see that some of my futures are fulfilled sometimes. Is there a flag I can set to dump information upon rejection of a future?
<chrisseaton>
I don't think so
<chrisseaton>
Can you post some code?
<chrisseaton>
Maybe your whole approach to using futures could be improved?
<opt_abel>
No doubt it could be improved. But since it was working under 0.9.0 and 9.0.0.0, I'm wondering what happened. I haven't updated Ruby itself.
<opt_abel>
It runs under concurrent-ruby 1.0.2 and JRuby 9.0.0.0, so I'm guessing it has to be a 9.0.0.0 -> 9.1.6.0 change.
<opt_abel>
I wonder if the implementation of the Java thread pools was changed. I haven't kept up on your progress.
<opt_abel>
Normally my program defaults to initiailizing a new Concurrent::FixedThreadPool.new(8) for 8 threads. If I force it to 1, it runs again.
<opt_abel>
I tried running under different JDK versions. 1.8.0 build 51 and 111 both work the same. So I think I've isolated the issue to JRuby 9.1.6.0 vs 9.0.0.0rc2. Forcing a thread pool of size 1 works in either version. A thread pool of >1 works under only 9.0.0.0rc2.
<opt_abel>
The concurrent-ruby gem version doesn't seem to differ between 0.9.0 and 1.0.2.
<opt_abel>
Per concurrent-ruby's documentation, I can't check the thread pool's "can_overflow?" since it appears it always returns false. Java's documentation indicates default thread pools are always unbounded for queue max size.
shellac has quit [Quit: Computer has gone to sleep.]
ryez has joined #jruby
sam2000 has joined #jruby
shellac has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
sam2000_ has joined #jruby
<sam2000_>
Hi, Could anyone please let me know what would be the best way to pass a database connection from a jruby/rails app to a java libray? I am using some clojure code with rails and all workds fine but it would be great if I can query the Posgresql databse directly from Clojure (or Java) code please
sam2000_ has quit [Client Quit]
sam2000 has quit [Remote host closed the connection]
sam2000 has joined #jruby
sam2000 has quit [Ping timeout: 246 seconds]
shellac has joined #jruby
shellac has quit [Client Quit]
shellac has joined #jruby
olle has joined #jruby
byteit101 has joined #jruby
olle has quit [Quit: olle]
shellac has quit [Quit: Computer has gone to sleep.]
pawnbox has joined #jruby
pawnbox_ has quit [Ping timeout: 252 seconds]
thedarkone2 has joined #jruby
<chrisseaton>
What get merged to master? I'm 357 commits behind.
<chrisseaton>
Ah dragon did the Truffle merge.
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #jruby
pawnbox has quit [Ping timeout: 248 seconds]
olle has joined #jruby
sam2000 has joined #jruby
sam2000_ has joined #jruby
sam2000 has quit [Client Quit]
sam2000_ has quit [Remote host closed the connection]
sam2000 has joined #jruby
sam2000_ has joined #jruby
alex0ptr has joined #jruby
ryez has quit [Ping timeout: 260 seconds]
sam2000_ has quit [Client Quit]
sam2000 has quit [Remote host closed the connection]