datamapper / do

DataObjects
147 stars 74 forks source link

do_postgres halts execution when running through Net::SSH::Gateway #46

Closed tpitale closed 8 years ago

tpitale commented 11 years ago

On ruby 1.9.3p286, I think that the thread keeping the connection event loop open here: https://github.com/net-ssh/net-ssh-gateway/blob/master/lib/net/ssh/gateway.rb#L195 is preventing DO from connecting to a postgres database over that gateway. Putting the connection in another thread has no effect.

I suspect that this is do to the lack of real threading in ruby, even with 1.9.3's improvements. The reason I think this is because if I attempt to make the connection in a fork process everything works as expected.

On the other hand, Net::SSH and regular ruby continue to proceed inside the gateway due to the use of Thread.pass. So I'm still, I'm not sure why DO would simply stop execution. The process simply halts, no warnings, no errors, no timeout, it doesn't ever stop. Even hitting control-c doesn't kill the process. I have to ctrl-z and kill -9 the pid.

Can anyone confirm my suspicion or offer a hint as to what might be going on?

tpitale commented 8 years ago

Closing this as a complete mystery. I changed the way I do the tunnel (external process) to get around the threading issue.