SOAP4r, threads, and Windows ... the mystery

Discussion in 'Ruby' started by Clark Snowdall, May 24, 2007.

  1. Hello,

    I am part of a team developing a remote computing tool of sorts. My
    part is to write the part that accesses a remote machine and dispatches
    essentially a batch job on that machine and fetches the output from the
    process. I have decided to use SOAP as the communication protocol.
    Everything was well and good until we started tackling batch jobs on
    remote machines that would last longer than the SOAP timeout.

    I came up with a prototype that uses two SOAP servers to communicate
    between the initiating machine and the remote machine running the batch
    file. I then put the batch call into a thread and when it completes it
    notifies the initiating machine through its SOAP server.

    Here's where things get interesting. If both machines are Unix (I've
    tested on FC6 and Mac OS X), everything works fine. But, if the remote
    machine executing the batch file is Windows, then the SOAP call to
    initiate the run of the batch thread blocks until that thread completes,
    even though you can see execution PAST the thread start. And if the
    batch file thread takes longer, then hte SOAP connection times out on
    the client end. It sems that there is some issues in how SOAP and
    thread execution are handled on Windows.

    In the short term I was going to punt on this: capture the timeout error
    and move on (as usual we have a product demo coming up). But I'd
    eventually like a more elegant solution. I'm hoping someone else on
    this list might have seen something like this before.

    You can find the source of my prototype at:

    http://homepage.mac.com/snowdall/.Public/upload.tar

    To run it:
    1. untar the package
    2. in one terminal window cd into the directory and type "ruby
    inner_wrapper_server.rb" to start the process that would be on the
    remote machine
    3. in another terminal window, cd into the directory and type "ruby
    runner.rb" to start the process from the initiating machine.

    The file core.rb represents what would be the remote batch file. The
    set_input and get_output methods would be used to send input to the
    batch file and get the output repsectively. Try running it on Unix and
    it works ... trying Windows and it fails.

    Good luck and thanks,
    Snowdall

    --
    Posted via http://www.ruby-forum.com/.
    Clark Snowdall, May 24, 2007
    #1
    1. Advertising

  2. Clark Snowdall

    Phil Meier Guest

    Hi

    > Hello,
    >
    > I am part of a team developing a remote computing tool of sorts. My
    > part is to write the part that accesses a remote machine and dispatches
    > essentially a batch job on that machine and fetches the output from the
    > process. I have decided to use SOAP as the communication protocol.
    > Everything was well and good until we started tackling batch jobs on
    > remote machines that would last longer than the SOAP timeout.
    >
    > I came up with a prototype that uses two SOAP servers to communicate
    > between the initiating machine and the remote machine running the batch
    > file. I then put the batch call into a thread and when it completes it
    > notifies the initiating machine through its SOAP server.
    >
    > Here's where things get interesting. If both machines are Unix (I've
    > tested on FC6 and Mac OS X), everything works fine. But, if the remote
    > machine executing the batch file is Windows, then the SOAP call to
    > initiate the run of the batch thread blocks until that thread completes,
    > even though you can see execution PAST the thread start. And if the
    > batch file thread takes longer, then hte SOAP connection times out on
    > the client end. It sems that there is some issues in how SOAP and
    > thread execution are handled on Windows.


    That's the point - threading in Ruby is done the "green threading" way.
    It does not uses real windows threads.
    Search for Ruby/Threading in this newsgroup and you will find many hints.

    >
    > In the short term I was going to punt on this: capture the timeout error
    > and move on (as usual we have a product demo coming up). But I'd
    > eventually like a more elegant solution. I'm hoping someone else on
    > this list might have seen something like this before.
    >
    > You can find the source of my prototype at:
    >
    > http://homepage.mac.com/snowdall/.Public/upload.tar
    >
    > To run it:
    > 1. untar the package
    > 2. in one terminal window cd into the directory and type "ruby
    > inner_wrapper_server.rb" to start the process that would be on the
    > remote machine
    > 3. in another terminal window, cd into the directory and type "ruby
    > runner.rb" to start the process from the initiating machine.
    >
    > The file core.rb represents what would be the remote batch file. The
    > set_input and get_output methods would be used to send input to the
    > batch file and get the output repsectively. Try running it on Unix and
    > it works ... trying Windows and it fails.
    >
    > Good luck and thanks,
    > Snowdall
    >


    BR
    Phil
    Phil Meier, May 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wolfgang
    Replies:
    5
    Views:
    1,459
    Tris Orendorff
    Feb 19, 2004
  2. Mark Moeykens
    Replies:
    2
    Views:
    520
    Mark Moeykens
    Sep 7, 2010
  3. David Moore
    Replies:
    1
    Views:
    81
    NAKAMURA, Hiroshi
    Nov 18, 2003
  4. Une bévue
    Replies:
    0
    Views:
    131
    Une bévue
    Jun 14, 2006
  5. Phil Tomson
    Replies:
    3
    Views:
    121
    Joel VanderWerf
    Aug 31, 2006
Loading...

Share This Page