Forum: JRuby SocketError under JRuby but not MRI

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris W. (Guest)
on 2009-03-31 23:06
(Received via mailing list)
I've been tracking down an issue with a JRuby on Rails application I'm
running (JRuby = 1.2.0, Rails = 2.2.2), and the difference seems to be
JRuby.

I've modified the built-in spawner
(vendor/rails/railties/lib/commands/process/spawner.rb) to launch JRuby
mongrels. To avoid installing RubyGems and Mongrel for MRI, I also
switched
my script/process/spawner script to use JRuby instead of MRI. It works
fine
for what anecdotally appears to be about the first half hour. After
that, I
start getting a SocketError with message = "initialize: name or service
not
known" on "srv = TCPServer.new(OPTIONS[:address], port)": (I added a
rescue
and puts)

/opt/jruby-1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/mongrel/tcphack.rb:12:in
`initialize_with_backlog'
...

When I changed back to MRI, it works and doesn't ever start giving that
Exception.

Is this a known issue or should I file a bug?

-chris
Ikai L. (Guest)
on 2009-03-31 23:17
(Received via mailing list)
Chris, is there a reason you are using Mongrel instead of Glassfish
Rails or WAR file deployment? Those are the preferred methods for
running JRuby on Rails applications in production.

Ikai

On Mar 31, 2009, at 12:05 PM, Chris W. wrote:

> or service not known" on "srv = TCPServer.new(OPTIONS[:address],
>
> -chris






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Chris W. (Guest)
on 2009-03-31 23:25
(Received via mailing list)
The two reasons are 1) pre-JRuby familiarity with and scripts using
mongrel,
and 2) I didn't find an easy way to switch stages in Warbler builds.

I'm sure there's a simple answer for #2--I just hadn't put enough time
into
figuring it out.

-chris
Ikai L. (Guest)
on 2009-03-31 23:34
(Received via mailing list)
That's understandable, but I would investigate a migration path. Even
though JRuby is more or less a drop-in replacement for Ruby, entire
environments have been constructed around Rails that solve problems in
a very single-process, UNIX-fork way that aren't really the best
practices when it comes to JVM applications.

I think the fact that there even exists a file called "tcphack.rb"
should be a red flag.

Ikai

On Mar 31, 2009, at 12:24 PM, Chris W. wrote:

> Chris, is there a reason you are using Mongrel instead of Glassfish
> to be JRuby.
> /opt/jruby-1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
>
>
Ikai L.
removed_email_address@domain.invalid
Chris W. (Guest)
on 2009-03-31 23:38
(Received via mailing list)
I, of course, agree with you. When I get some free cycles (laugh), I'd
definitely like to migrate to the most up-to-date garden path.

The point, though, is less about making mongrel work and more about
identifying that there is something that is incompatible between MRI and
JRuby.

-chris
Charles Oliver N. (Guest)
on 2009-04-01 00:32
(Received via mailing list)
Chris W. wrote:
> I, of course, agree with you. When I get some free cycles (laugh), I'd
> definitely like to migrate to the most up-to-date garden path.
>
> The point, though, is less about making mongrel work and more about
> identifying that there is something that is incompatible between MRI and
> JRuby.

Ikai is right that you should be exploring other options, but we
definitely want to make the "old" options work too. Can you file a bug
and try to reduce the problem to a simple case?

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.