-
Notifications
You must be signed in to change notification settings - Fork 118
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
Jruby error #75
Comments
JRuby support is not guaranteed because concurrent-ruby gem has now troubles on JRuby, if you are looking for a threaded solution you might be interested in https://github.com/rubycdp/vessel |
Hey @route @oshanz , I have a Sidekiq Job that opens a website and navigates through 5 pages while filling input fields and checking radio/checkboxes. I haven't gone through entire Ferrum code, so my patch might be incorrect or doesn't make sense. But, Here's what I did to possibly fix Concurrent::MultipleAssignmentError issue in my app. # file: lib/ferrum/browser/client.rb
def initialize
# .....
#
while message = @ws.messages.pop
if INTERRUPTIONS.include?(message["method"])
@interruptor.async.call(message)
elsif message.key?("method")
@subscriber.async.call(message)
else
# here's the change
retries_left = 3
begin
@pendings[message["id"]]&.set(message)
rescue Concurrent::MultipleAssignmentError => e
retries_left -= 1
if retries_left > 0
# retry after sleeping 200ms
sleep(0.2)
retry
end
raise e
end
end
end
# .....
end After this patch, I am yet to see any issues in my script. Plus, app doesn't throw that exception and terminate anymore. |
@rajuvvadi I'm afraid it's only a hack, which doesn't solve the real issue |
below script works fine on MRI but fails sometime on Jruby
output
please run multiple attempts to see the errors.
I can see browser opening blank tabs. that cause to print
Timed out waiting for response. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the :timeout option to a higher value might help.
and when I wasn't handling the exception rescue I got same warning as above. so I guess it relate to page close method?The text was updated successfully, but these errors were encountered: