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

Actor Crash on Code Submit #134

Closed
tycrowe opened this issue Jun 19, 2018 · 4 comments
Closed

Actor Crash on Code Submit #134

tycrowe opened this issue Jun 19, 2018 · 4 comments

Comments

@tycrowe
Copy link

tycrowe commented Jun 19, 2018

I've been working on setting up a server for hosting code workout, however when I attempt to submit code through the running rails server, I get that the actor has crashed. The resulting error is below:

Actor crashed!
Errno::ECONNREFUSED: Failed to open TCP connection to localhost:8080 (Connection refused - connect(2) for "localhost" port 8080)
	/usr/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'
	/usr/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'
	/usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
	/usr/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
	/usr/lib/ruby/2.3.0/net/http.rb:878:in `connect'
	/usr/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
	/usr/lib/ruby/2.3.0/net/http.rb:852:in `start'
	/usr/lib/ruby/2.3.0/net/http.rb:584:in `start'
	/usr/lib/ruby/2.3.0/net/http.rb:479:in `get_response'
	/vagrant/app/jobs/code_worker.rb:151:in `execute_javatest'
	/vagrant/app/jobs/code_worker.rb:83:in `block in perform'
	/var/lib/gems/2.3.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
	/vagrant/app/jobs/code_worker.rb:20:in `perform'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
	/var/lib/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

The ports are configured correctly as far as I can tell on the guest as well as the host but I don't think the java-daemon is running. Is there a well-documented cause for this error?

@tycrowe
Copy link
Author

tycrowe commented Jun 19, 2018

Follow up, the command netstat -tupln reports there is nothing active on port 8080 when the rails server is running. I imagine that something should be, I'm just not sure what.

@tycrowe
Copy link
Author

tycrowe commented Jun 20, 2018

Issue resolved. Solved by removing the security arguments from the ant command in the config.rb file and commenting out the javadaemon mention just below.

@tycrowe tycrowe closed this as completed Jun 20, 2018
@s-edwards
Copy link
Member

Sorry there were no docs on that. The initial version of CodeWorkout used ANT (using the settings in that config.rb file). This took 1-2 seconds per Java submission to process, and the JVM startup was very CPU intensive (and very difficult to speed up). Now, the default config.rb in the production branch (and also master) is set to use a custom daemon process that provides for a "live" (already started) JVM to do compilation and execution, which increased throughput more than 30x. Using ANT is fine during development, but is not advisable for production. The settings are still in there, since this is the fallback we typically use during development when the stand-alone Java processing daemon process isn't available.

However, ANT isn't recommended for production. You'll find that the ANT support no longer correctly reports compiler errors. That's fixable, but if you see submissions with /no/ feedback at all, that may be because compilation silently failed and the errors weren't reported properly. This is due to slightly different formatting of error messages in the standard compiler text output produced via ANT, vs. the internal java compiler calls made by the stand-alone Java daemon.

Open another issue if you run into anything separate. Glad you found the problem and were able to get by it, though.

@tycrowe
Copy link
Author

tycrowe commented Jun 21, 2018

No problem and thank you for the heads-up on not using ANT for production. Any advice on setting up my own JVM daemon? I just noticed that you're absolutely right: some of the exercises don't provide any feedback whatsoever. I'd like feedback to be seen by the user for any reason.

Thanks again

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

2 participants