Csongor Gyuricza
2008-Jul-15 19:51 UTC
[Backgroundrb-devel] Method hangs for the first time if called synchronously
This is my first post so I apologize if I am not using the expected conventions. With backgroundrb version 1.0.4 and Rails version 2.1.0 The problem happens when you call a method for the first time without using async_ Steps to reproduce: 1) Create a new worker with a simple method, that just has logger.info''blabla''. For the example the method is called "ppp" and worker is "test_manager" 2) Start backgroundrb and open the rails console Type in:>> worker = MiddleMan.worker(:test_manager_worker)=> #<BackgrounDRb::Rai........ >>>> worker.async_ppp=> nil I see ''blabla'' in the log>> worker.ppp=> true I see ''blabla'' in the log again Everything works until now. Now to reproduce the problem: 1) Exit console 2) Restart backgroundrb and reopen rails console Type in:>> worker = MiddleMan.worker(:test_manager_worker)=> #<BackgrounDRb::Rai........ >>>> worker.pppIt hangs and never returns. I see nothing in the log. When I abort I get: CIRB::Abort: abort then interrupt!! from /opt/local/lib/ruby/1.8/irb.rb:81:in `irb_abort'' from /opt/local/lib/ruby/1.8/irb.rb:243:in `signal_handle'' from /opt/local/lib/ruby/1.8/irb.rb:66:in `start'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in `call'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in `select'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in `read_from_bdrb'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in `send_request'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in `synchronize'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in `send_request'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in `send'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in `invoke_on_connection'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:57:in `run_method'' from /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:33:in `method_missing'' from (irb):2 Then when I exit the console, I see "blabla" in the log. Is this a bug? Another rails user was able to reproduce this same problem. Is this a bug or are we missing something? This is not only happening in the console, it happens in my application as well. I used the console as an example as it is easier to explain. Thank you, Csongor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080715/4b5853d1/attachment.html>
hemant
2008-Jul-15 20:09 UTC
[Backgroundrb-devel] Method hangs for the first time if called synchronously
can you please test the same thing on linux and tell me if it happens there too? i am aware of something like this happening on mac! On 7/16/08, Csongor Gyuricza <csgyuricza at gmail.com> wrote:> This is my first post so I apologize if I am not using the expected > conventions. > With backgroundrb version 1.0.4 and Rails version 2.1.0 > > The problem happens when you call a method for the first time without using > async_ > > Steps to reproduce: > > 1) Create a new worker with a simple method, that just has > logger.info''blabla''. For the example the method is called "ppp" and > worker is > "test_manager" > 2) Start backgroundrb and open the rails console > > Type in: > >>> worker = MiddleMan.worker(:test_manager_worker) > => #<BackgrounDRb::Rai........ >> >>> worker.async_ppp > => nil > I see ''blabla'' in the log >>> worker.ppp > => true > I see ''blabla'' in the log again > > Everything works until now. > > Now to reproduce the problem: > > 1) Exit console > 2) Restart backgroundrb and reopen rails console > > Type in: > >>> worker = MiddleMan.worker(:test_manager_worker) > => #<BackgrounDRb::Rai........ >> >>> worker.ppp > > It hangs and never returns. I see nothing in the log. When I abort I get: > > CIRB::Abort: abort then interrupt!! > from /opt/local/lib/ruby/1.8/irb.rb:81:in `irb_abort'' > from /opt/local/lib/ruby/1.8/irb.rb:243:in `signal_handle'' > from /opt/local/lib/ruby/1.8/irb.rb:66:in `start'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in > `call'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in > `select'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in > `read_from_bdrb'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in > `send_request'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in > `synchronize'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in > `send_request'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in > `send'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in > `invoke_on_connection'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:57:in > `run_method'' > from > /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:33:in > `method_missing'' > from (irb):2 > > Then when I exit the console, I see "blabla" in the log. > > Is this a bug? Another rails user was able to reproduce this same problem. > Is this a bug or are we missing something? > This is not only happening in the console, it happens in my application as > well. I used the console as an example as it is easier to explain. > > Thank you, > > Csongor >-- Sent from Gmail for mobile | mobile.google.com Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
Jonathan Wallace
2008-Jul-15 20:29 UTC
[Backgroundrb-devel] Method hangs for the first time if called synchronously
I wasn''t able to reproduce it on linux. Any suggestions on where to look in the code for debugging the issue on the mac? Jonathan On Tue, Jul 15, 2008 at 4:09 PM, hemant <gethemant at gmail.com> wrote:> can you please test the same thing on linux and tell me if it happens there too? > > i am aware of something like this happening on mac! > > On 7/16/08, Csongor Gyuricza <csgyuricza at gmail.com> wrote: >> This is my first post so I apologize if I am not using the expected >> conventions. >> With backgroundrb version 1.0.4 and Rails version 2.1.0 >> >> The problem happens when you call a method for the first time without using >> async_ >> >> Steps to reproduce: >> >> 1) Create a new worker with a simple method, that just has >> logger.info''blabla''. For the example the method is called "ppp" and >> worker is >> "test_manager" >> 2) Start backgroundrb and open the rails console >> >> Type in: >> >>>> worker = MiddleMan.worker(:test_manager_worker) >> => #<BackgrounDRb::Rai........ >> >>>> worker.async_ppp >> => nil >> I see ''blabla'' in the log >>>> worker.ppp >> => true >> I see ''blabla'' in the log again >> >> Everything works until now. >> >> Now to reproduce the problem: >> >> 1) Exit console >> 2) Restart backgroundrb and reopen rails console >> >> Type in: >> >>>> worker = MiddleMan.worker(:test_manager_worker) >> => #<BackgrounDRb::Rai........ >> >>>> worker.ppp >> >> It hangs and never returns. I see nothing in the log. When I abort I get: >> >> CIRB::Abort: abort then interrupt!! >> from /opt/local/lib/ruby/1.8/irb.rb:81:in `irb_abort'' >> from /opt/local/lib/ruby/1.8/irb.rb:243:in `signal_handle'' >> from /opt/local/lib/ruby/1.8/irb.rb:66:in `start'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >> `call'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >> `select'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >> `read_from_bdrb'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >> `send_request'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >> `synchronize'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >> `send_request'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in >> `send'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in >> `invoke_on_connection'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:57:in >> `run_method'' >> from >> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:33:in >> `method_missing'' >> from (irb):2 >> >> Then when I exit the console, I see "blabla" in the log. >> >> Is this a bug? Another rails user was able to reproduce this same problem. >> Is this a bug or are we missing something? >> This is not only happening in the console, it happens in my application as >> well. I used the console as an example as it is easier to explain. >> >> Thank you, >> >> Csongor >> > > -- > Sent from Gmail for mobile | mobile.google.com > > Let them talk of their oriental summer climes of everlasting > conservatories; give me the privilege of making my own summer with my > own coals. > > http://gnufied.org > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >
hemant
2008-Jul-15 20:41 UTC
[Backgroundrb-devel] Method hangs for the first time if called synchronously
its there in packet code actually. in file packet_nbio.rb, while reading the data this happens. you will find a line thatz commented. On 7/16/08, Jonathan Wallace <jonathan.wallace at gmail.com> wrote:> I wasn''t able to reproduce it on linux. Any suggestions on where to > look in the code for debugging the issue on the mac? > Jonathan > > On Tue, Jul 15, 2008 at 4:09 PM, hemant <gethemant at gmail.com> wrote: >> can you please test the same thing on linux and tell me if it happens >> there too? >> >> i am aware of something like this happening on mac! >> >> On 7/16/08, Csongor Gyuricza <csgyuricza at gmail.com> wrote: >>> This is my first post so I apologize if I am not using the expected >>> conventions. >>> With backgroundrb version 1.0.4 and Rails version 2.1.0 >>> >>> The problem happens when you call a method for the first time without >>> using >>> async_ >>> >>> Steps to reproduce: >>> >>> 1) Create a new worker with a simple method, that just has >>> logger.info''blabla''. For the example the method is called "ppp" and >>> worker is >>> "test_manager" >>> 2) Start backgroundrb and open the rails console >>> >>> Type in: >>> >>>>> worker = MiddleMan.worker(:test_manager_worker) >>> => #<BackgrounDRb::Rai........ >> >>>>> worker.async_ppp >>> => nil >>> I see ''blabla'' in the log >>>>> worker.ppp >>> => true >>> I see ''blabla'' in the log again >>> >>> Everything works until now. >>> >>> Now to reproduce the problem: >>> >>> 1) Exit console >>> 2) Restart backgroundrb and reopen rails console >>> >>> Type in: >>> >>>>> worker = MiddleMan.worker(:test_manager_worker) >>> => #<BackgrounDRb::Rai........ >> >>>>> worker.ppp >>> >>> It hangs and never returns. I see nothing in the log. When I abort I get: >>> >>> CIRB::Abort: abort then interrupt!! >>> from /opt/local/lib/ruby/1.8/irb.rb:81:in `irb_abort'' >>> from /opt/local/lib/ruby/1.8/irb.rb:243:in `signal_handle'' >>> from /opt/local/lib/ruby/1.8/irb.rb:66:in `start'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >>> `call'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >>> `select'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:157:in >>> `read_from_bdrb'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >>> `send_request'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >>> `synchronize'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:171:in >>> `send_request'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in >>> `send'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:70:in >>> `invoke_on_connection'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:57:in >>> `run_method'' >>> from >>> /Users/csgyuricza/Sites/Automation/vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:33:in >>> `method_missing'' >>> from (irb):2 >>> >>> Then when I exit the console, I see "blabla" in the log. >>> >>> Is this a bug? Another rails user was able to reproduce this same >>> problem. >>> Is this a bug or are we missing something? >>> This is not only happening in the console, it happens in my application >>> as >>> well. I used the console as an example as it is easier to explain. >>> >>> Thank you, >>> >>> Csongor >>> >> >> -- >> Sent from Gmail for mobile | mobile.google.com >> >> Let them talk of their oriental summer climes of everlasting >> conservatories; give me the privilege of making my own summer with my >> own coals. >> >> http://gnufied.org >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >> >-- Sent from Gmail for mobile | mobile.google.com Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
hemant
2008-Jul-16 18:23 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
On Wed, Jul 16, 2008 at 2:11 AM, Csongor Gyuricza <csgyuricza at gmail.com> wrote:> I forgot to mention that this is on a Mac. > Unfortunately I don''t have a linux box easily available, I''d have to setup > one. I won''t be able to do it today, I can do it in a couple of days unless > someone else does it before.Can you try following fix in packet and report if this fixes your issue: --- a/lib/packet/packet_nbio.rb +++ b/lib/packet/packet_nbio.rb @@ -13,8 +13,8 @@ module Packet def read_data(t_sock) sock_data = [] begin - while(t_data = t_sock.read_nonblock((16*1024)-1)) - #raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty? + while(t_data = t_sock.recv_nonblock((16*1024)-1)) + raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty? sock_data << t_data end rescue Errno::EAGAIN Unfortunately, I don''t have Mac OSX, for testing and hence the problem. Thanks for your patience. -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
Jonathan Wallace
2008-Jul-16 18:35 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
It didn''t fix it for me. Jonathan On Wed, Jul 16, 2008 at 2:23 PM, hemant <gethemant at gmail.com> wrote:> On Wed, Jul 16, 2008 at 2:11 AM, Csongor Gyuricza <csgyuricza at gmail.com> wrote: >> I forgot to mention that this is on a Mac. >> Unfortunately I don''t have a linux box easily available, I''d have to setup >> one. I won''t be able to do it today, I can do it in a couple of days unless >> someone else does it before. > > Can you try following fix in packet and report if this fixes your issue: > > --- a/lib/packet/packet_nbio.rb > +++ b/lib/packet/packet_nbio.rb > @@ -13,8 +13,8 @@ module Packet > def read_data(t_sock) > sock_data = [] > begin > - while(t_data = t_sock.read_nonblock((16*1024)-1)) > - #raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty? > + while(t_data = t_sock.recv_nonblock((16*1024)-1)) > + raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty? > sock_data << t_data > end > rescue Errno::EAGAIN > > Unfortunately, I don''t have Mac OSX, for testing and hence the problem. > > > Thanks for your patience. > > > > -- > Let them talk of their oriental summer climes of everlasting > conservatories; give me the privilege of making my own summer with my > own coals. > > http://gnufied.org > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >
Martin Honermeyer
2008-Jul-17 12:31 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
Hello guys, I just installed Backgroundrb (SVN via piston, Packet gem 0.1.7) in my Rails 2.1 project. As far as I can tell, I am experiencing exactly the same problem. On Linux, that is (Ubuntu 8.04, Kernel 2.6.22-14-xen)! The first asynchronous worker calls (in console) worked. Then, after restarting Backgroundrb and the console, Every synchronous call hangs at the same position as told by Jonathan. Asynchronous calls then have no effect either. Hemant, I tried your patch, but it doesn''t change anything for me. I will do anything to help ;-/ Greetz, Martin On Wednesday 16 July 2008 20:35:50 Jonathan Wallace wrote:> It didn''t fix it for me. > Jonathan > > On Wed, Jul 16, 2008 at 2:23 PM, hemant <gethemant at gmail.com> wrote: > > On Wed, Jul 16, 2008 at 2:11 AM, Csongor Gyuricza <csgyuricza at gmail.com>wrote:> >> I forgot to mention that this is on a Mac. > >> Unfortunately I don''t have a linux box easily available, I''d have to > >> setup one. I won''t be able to do it today, I can do it in a couple of > >> days unless someone else does it before. > > > > Can you try following fix in packet and report if this fixes your issue: > > > > --- a/lib/packet/packet_nbio.rb > > +++ b/lib/packet/packet_nbio.rb > > @@ -13,8 +13,8 @@ module Packet > > def read_data(t_sock) > > sock_data = [] > > begin > > - while(t_data = t_sock.read_nonblock((16*1024)-1)) > > - #raise DisconnectError.new(t_sock,sock_data.join) if > > t_data.empty? + while(t_data = t_sock.recv_nonblock((16*1024)-1)) > > + raise DisconnectError.new(t_sock,sock_data.join) if > > t_data.empty? sock_data << t_data > > end > > rescue Errno::EAGAIN > > > > Unfortunately, I don''t have Mac OSX, for testing and hence the problem. > > > > > > Thanks for your patience. > > > > > > > > -- > > Let them talk of their oriental summer climes of everlasting > > conservatories; give me the privilege of making my own summer with my > > own coals. > > > > http://gnufied.org > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
hemant
2008-Jul-17 13:44 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
On Thu, Jul 17, 2008 at 6:01 PM, Martin Honermeyer <maze at strahlungsfrei.de> wrote:> Hello guys, > > I just installed Backgroundrb (SVN via piston, Packet gem 0.1.7) in my Rails > 2.1 project. As far as I can tell, I am experiencing exactly the same problem. > On Linux, that is (Ubuntu 8.04, Kernel 2.6.22-14-xen)! > > The first asynchronous worker calls (in console) worked. Then, after restarting > Backgroundrb and the console, Every synchronous call hangs at the same > position as told by Jonathan. Asynchronous calls then have no effect either. > > Hemant, I tried your patch, but it doesn''t change anything for me. I will do > anything to help ;-/ >Okay. Can you pastie your worker code and rails/controller code, using which you are invoking this methods. Also, please paste the code as you are using. I will see, if I can reproduce this behaviour. Also, Check the logs. both backgroundrb_debug_11006.log and backgroundrb_11006.log and if there is any exception there. Lastly, what exactly you are trying to send from your worker code? You realize, not everything in ruby can be dumped across wire.
Csongor Gyuricza
2008-Jul-17 16:22 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
Hemant, As mentioned in my first email, this happens even when your worker has no code (or only a logger.info line) and no arguments passed. Nothing shows up in the log, it just hangs. Please refer to my first email and let me know if you have any additional questions. Thank you for helping us with this issue. Csongor On Thu, Jul 17, 2008 at 6:44 AM, hemant <gethemant at gmail.com> wrote:> On Thu, Jul 17, 2008 at 6:01 PM, Martin Honermeyer > <maze at strahlungsfrei.de> wrote: > > Hello guys, > > > > I just installed Backgroundrb (SVN via piston, Packet gem 0.1.7) in my > Rails > > 2.1 project. As far as I can tell, I am experiencing exactly the same > problem. > > On Linux, that is (Ubuntu 8.04, Kernel 2.6.22-14-xen)! > > > > The first asynchronous worker calls (in console) worked. Then, after > restarting > > Backgroundrb and the console, Every synchronous call hangs at the same > > position as told by Jonathan. Asynchronous calls then have no effect > either. > > > > Hemant, I tried your patch, but it doesn''t change anything for me. I will > do > > anything to help ;-/ > > > > Okay. Can you pastie your worker code and rails/controller code, using > which you are invoking this methods. Also, please paste the code as > you are using. I will see, if I can reproduce this behaviour. > > Also, Check the logs. both backgroundrb_debug_11006.log and > backgroundrb_11006.log and if there is any exception there. > > Lastly, what exactly you are trying to send from your worker code? You > realize, not everything in ruby can be dumped across wire. > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080717/07a2218a/attachment.html>
Martin Honermeyer
2008-Jul-17 16:47 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
I second that. I can remove all code from my worker so only the code from the generator is left. It hangs even when calling a not-existing worker. From the Rails console:>> MiddleMan.worker(:dfsfd)=> #<BackgrounDRb::RailsWorkerProxy:0xb6af77e0 @middle_man=#<BackgrounDRb::ClusterConnection:0xb76d06ac @backend_connections=[#<BackgrounDRb::Connection:0xb76d03b4 @mutex=#<Mutex:0xb76d038c>, cluster_conn#<BackgrounDRb::ClusterConnection:0xb76d06ac ..., @server_port=11006, @server_ip="0.0.0.0", @connection_status=true>], request_count1, bdrb_servers[#<struct #<Class:0xb76d05e4 ip="0.0.0.0", port=11006], @round_robin=[0], @last_polled_time=Thu Jul 17 18:30:09 +0200 2008, @disconnected_connections={}>, worker_keynil, tried_connections[], worker_name:dfsfd>> MiddleMan.worker(:dfsfd).sdfsdf(hangs) I am calling from the console (didn''t even try from within a controller). There is _nothing_ posted in the backgroundrb logs. For me it seems like there is no connection to the backgroundrb server at all. I even rebooted the (Xen virtual Linux) machine, but the problem remains. My background.yml: --- :backgroundrb: :port: 11006 :ip: 0.0.0.0 :debug_log: false # whether to print debug logs to a seperate worker, defaults to true :log: foreground # will print log messages to STDOUT, defaults to seperate log worker Martin On Thursday 17 July 2008 18:22:34 you wrote:> Hemant, > > As mentioned in my first email, this happens even when your worker has no > code (or only a logger.info line) and no arguments passed. Nothing shows up > in the log, it just hangs. > > Please refer to my first email and let me know if you have any additional > questions. > > Thank you for helping us with this issue. > > Csongor > > On Thu, Jul 17, 2008 at 6:44 AM, hemant <gethemant at gmail.com> wrote: > > On Thu, Jul 17, 2008 at 6:01 PM, Martin Honermeyer > > > > <maze at strahlungsfrei.de> wrote: > > > Hello guys, > > > > > > I just installed Backgroundrb (SVN via piston, Packet gem 0.1.7) in my > > > > Rails > > > > > 2.1 project. As far as I can tell, I am experiencing exactly the same > > > > problem. > > > > > On Linux, that is (Ubuntu 8.04, Kernel 2.6.22-14-xen)! > > > > > > The first asynchronous worker calls (in console) worked. Then, after > > > > restarting > > > > > Backgroundrb and the console, Every synchronous call hangs at the same > > > position as told by Jonathan. Asynchronous calls then have no effect > > > > either. > > > > > Hemant, I tried your patch, but it doesn''t change anything for me. I > > > will > > > > do > > > > > anything to help ;-/ > > > > Okay. Can you pastie your worker code and rails/controller code, using > > which you are invoking this methods. Also, please paste the code as > > you are using. I will see, if I can reproduce this behaviour. > > > > Also, Check the logs. both backgroundrb_debug_11006.log and > > backgroundrb_11006.log and if there is any exception there. > > > > Lastly, what exactly you are trying to send from your worker code? You > > realize, not everything in ruby can be dumped across wire. > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
hemant
2008-Jul-17 17:31 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
On Thu, Jul 17, 2008 at 10:17 PM, Martin Honermeyer <maze at strahlungsfrei.de> wrote:> I second that. I can remove all code from my worker so only the code from the > generator is left.> It hangs even when calling a not-existing worker. From the Rails console:Please read below. There is no point in doing this kinda testing.> >>> MiddleMan.worker(:dfsfd) > => #<BackgrounDRb::RailsWorkerProxy:0xb6af77e0 > @middle_man=#<BackgrounDRb::ClusterConnection:0xb76d06ac > @backend_connections=[#<BackgrounDRb::Connection:0xb76d03b4 > @mutex=#<Mutex:0xb76d038c>, > cluster_conn#<BackgrounDRb::ClusterConnection:0xb76d06ac ..., > @server_port=11006, @server_ip="0.0.0.0", @connection_status=true>], > request_count1, bdrb_servers[#<struct #<Class:0xb76d05e4 ip="0.0.0.0", > port=11006], @round_robin=[0], @last_polled_time=Thu Jul 17 18:30:09 +0200 > 2008, @disconnected_connections={}>, worker_keynil, tried_connections[], > worker_name:dfsfd > >>> MiddleMan.worker(:dfsfd).sdfsdf > > (hangs) > > > I am calling from the console (didn''t even try from within a controller). > There is _nothing_ posted in the backgroundrb logs. > > For me it seems like there is no connection to the backgroundrb server at all. > I even rebooted the (Xen virtual Linux) machine, but the problem remains. > > > My background.yml: > > --- > :backgroundrb: > :port: 11006 > :ip: 0.0.0.0 > :debug_log: false # whether to print debug logs to a seperate worker, > defaults to true > :log: foreground # will print log messages to STDOUT, defaults to seperate > log workerYou have disabled logging, so no wonder your logs are clean. Also, when you invoke some call on a non-existent worker in a synchronous manner, call will obviously hang, because there is no worker that can respond to request. What you do expect there? However, if you have logging enabled and start backgroundrb with "./scrip/backgroundrb start", you can see an exception about non-existent worker logged in log files.
hemant
2008-Jul-17 17:34 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
On Thu, Jul 17, 2008 at 9:52 PM, Csongor Gyuricza <csgyuricza at gmail.com> wrote:> Hemant, > > As mentioned in my first email, this happens even when your worker has no > code (or only a logger.info line) and no arguments passed. Nothing shows up > in the log, it just hangs. > > Please refer to my first email and let me know if you have any additional > questions. > > Thank you for helping us with this issue. >Today I wrote this worker: class HelloWorker < BackgrounDRb::MetaWorker set_worker_name :hello_worker def create(args = nil) # some crap end def make_request logger.info "hello world" end end And invoked task on the worker from console as you said:>> MiddleMan.worker(:hello_worker).make_request=> "dummy_result" And I got a response immediately. So this obviously a Mac only issue, now trouble is, I don''t have Mac OSX for testing, so if anyone can give me ssh connection for a while, I will be thankful.
hemant
2008-Jul-18 04:52 UTC
[Backgroundrb-devel] Fwd: Method hangs for the first time if called synchronously
Please, update your packet gem to (0.1.8) and issue should go away. Thanks. On Thu, Jul 17, 2008 at 11:04 PM, hemant <gethemant at gmail.com> wrote:> On Thu, Jul 17, 2008 at 9:52 PM, Csongor Gyuricza <csgyuricza at gmail.com> wrote: >> Hemant, >> >> As mentioned in my first email, this happens even when your worker has no >> code (or only a logger.info line) and no arguments passed. Nothing shows up >> in the log, it just hangs. >> >> Please refer to my first email and let me know if you have any additional >> questions. >> >> Thank you for helping us with this issue. >> > > Today I wrote this worker: > > class HelloWorker < BackgrounDRb::MetaWorker > set_worker_name :hello_worker > def create(args = nil) > # some crap > end > > def make_request > logger.info "hello world" > end > end > > > > And invoked task on the worker from console as you said: >>> MiddleMan.worker(:hello_worker).make_request > => "dummy_result" > > And I got a response immediately. So this obviously a Mac only issue, > now trouble is, I don''t have Mac OSX for testing, so if anyone can > give me ssh connection for a while, I will be thankful. >-- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org