Celluloid::IO issue appears to be failing standard DNS lookup when using Celluloid::IO::TCPSocket inside of Http.rb. After hacking away down to a minimum set of reproable steps, here's the issue:
_Without Celluloid::IO::TCPSocket:_
Code:
require 'celluloid'
require 'celluloid/autostart'
require 'celluloid/io'
require 'http'
class HttpFetcher
include Celluloid::IO
def scan(url, options = {} )
# puts "Request -> http://#{url}"
use_options = true
if (use_options)
options = { socket_class: Celluloid::IO::TCPSocket
}
end
response = HTTP.get(url, options)
end
end
Testing:
[1] pry(main)> require 'http'
=> true
[2] pry(main)> HTTP.get("http://client")
=> #<HTTP::Response/1.1 200 OK {"Server"=>"nginx/1.6.2", "Date"=>"Wed, 13 May 2015 16:48:34 GMT", "Content-Type"=>"text/html;charset=utf-8", "Content-Length"=>"1131", "Connection"=>"close", "X-Xss-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff", "X-Frame-Options"=>"SAMEORIGIN"}>
[3] pry(main)> require './test'
=> true
[4] pry(main)> HttpFetcher.new.scan("http://client")
Resolv::ResolvError: DNS result has no information for client
from /var/lib/gems/2.1.0/gems/celluloid-io-0.16.2/lib/celluloid/io/tcp_socket.rb:64:in `initialize'
[5] pry(main)> E, [2015-05-13T16:48:43.333658 #388] ERROR -- : Actor crashed!
Resolv::ResolvError: DNS result has no information for client
/var/lib/gems/2.1.0/gems/celluloid-io-0.16.2/lib/celluloid/io/tcp_socket.rb:64:in `initialize'
/var/lib/gems/2.1.0/gems/celluloid-io-0.16.2/lib/celluloid/io/tcp_socket.rb:16:in `new'
/var/lib/gems/2.1.0/gems/celluloid-io-0.16.2/lib/celluloid/io/tcp_socket.rb:16:in `open'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/timeout/null.rb:18:in `connect'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/connection.rb:31:in `initialize'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/client.rb:72:in `new'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/client.rb:72:in `make_request'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/client.rb:58:in `block in perform'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/cache/null_cache.rb:9:in `perform'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/client.rb:57:in `perform'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/client.rb:46:in `request'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/chainable.rb:72:in `request'
/var/lib/gems/2.1.0/gems/http-0.8.4/lib/http/chainable.rb:16:in `get'
/home/app/dashapp/test.rb:26:in `scan'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
/var/lib/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
_Without Celluloid::IO::TCPSocket:_
Code:
require 'celluloid'
require 'celluloid/autostart'
require 'celluloid/io'
require 'http'
module Errors
class NoWebResponse < StandardError; end
end
class HttpFetcher
include Celluloid::IO
def scan(url, options = {} )
# puts "Request -> http://#{url}"
use_options = false
if (use_options)
options = { socket_class: Celluloid::IO::TCPSocket
}
end
response = HTTP.get(url, options)
end
end
Celluloid::IO issue appears to be failing standard DNS lookup when using Celluloid::IO::TCPSocket inside of Http.rb. After hacking away down to a minimum set of reproable steps, here's the issue:
_Without Celluloid::IO::TCPSocket:_
Code:
Testing:
_Without Celluloid::IO::TCPSocket:_
Code:
Testing: