You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Robey Pointer (JIRA)" <ji...@apache.org> on 2008/12/08 20:18:44 UTC

[jira] Created: (THRIFT-229) ruby client timeout does not affect connect()

ruby client timeout does not affect connect()
---------------------------------------------

                 Key: THRIFT-229
                 URL: https://issues.apache.org/jira/browse/THRIFT-229
             Project: Thrift
          Issue Type: Bug
          Components: Library (Ruby)
         Environment: all
            Reporter: Robey Pointer


the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-229:
---------------------------------

    Fix Version/s: 0.1

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665667#action_12665667 ] 

Bryan Duxbury commented on THRIFT-229:
--------------------------------------

I applied the patch and made the change you suggested, but I get tons of spec failures in socket_spec.rb. Can you run the specs locally and see if you can figure out what's going wrong?

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679774#action_12679774 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

worked for me before but works for me after, too, so -- here's a new patch with your change. :)


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, patch.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-229:
---------------------------------

    Attachment: thrift-229.patch

I think that this patch fixes the problem. Can you apply it locally and test it out?

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>         Attachments: thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Clark closed THRIFT-229.
------------------------------

    Resolution: Fixed

Pushed in 751142.

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, patch.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robey Pointer updated THRIFT-229:
---------------------------------

    Attachment: patch-3.txt

i think this should get it. it also required some changes to mocks.


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-229:
---------------------------------

    Patch Info: [Patch Available]

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury reassigned THRIFT-229:
------------------------------------

    Assignee: Bryan Duxbury

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667939#action_12667939 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

i was trying on a mac. just applied the patch on ubuntu and it worked the same there too.


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679697#action_12679697 ] 

Kevin Clark commented on THRIFT-229:
------------------------------------

Sorry for the wait on feedback for this one Robey. I'm getting the exact same failures as Bryan above. It's because the mocks in the specs aren't returning anything from the fake Socket.new. Lines 24 and 31 should be like:

       ::Socket.should_receive(:new).and_return(mock("Handle", :connect_nonblock => true))

If you tweak the patch, I'll commit. Thanks, and really sorry for the wait.

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666286#action_12666286 ] 

Bryan Duxbury commented on THRIFT-229:
--------------------------------------

I still get two failures:

{code}
1)
Thrift::TransportException in 'Thrift::Socket should open a ::Socket with default args'
Could not connect to localhost:9090: undefined method `connect_nonblock' for nil:NilClass
./spec/../lib/thrift/transport/socket.rb:42:in `open'
./spec/socket_spec.rb:27:

2)
Thrift::TransportException in 'Thrift::Socket should accept host/port options'
Could not connect to my.domain:1234: undefined method `connect_nonblock' for nil:NilClass
./spec/../lib/thrift/transport/socket.rb:42:in `open'
./spec/socket_spec.rb:34:
{code}


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666051#action_12666051 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

i get those too. this is the localhost problem -- ruby is having trouble with IP6 addresses (and localhost has a lot of IP6 aliases). i'm going to ask a ruby expert how to work around this.


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679407#action_12679407 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

ping! has this been applied yet?


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robey Pointer updated THRIFT-229:
---------------------------------

    Attachment: patch.txt

new patch

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>             Fix For: 0.1
>
>         Attachments: patch-2.txt, patch-3.txt, patch.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666355#action_12666355 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

works fine on both machines here. looks like you're getting a nil @handle. maybe try printing some debug info around that area? not sure why ruby would return nil from Socket.new tho.


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, patch-3.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robey Pointer updated THRIFT-229:
---------------------------------

    Attachment: patch-2.txt

that patch doesn't quite work because of namespace issues (and a missing arg). attached is a modification that makes it work for me.

one thing to note: IP6 addresses will break. this appears to be a bug in ruby.


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Robey Pointer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665569#action_12665569 ] 

Robey Pointer commented on THRIFT-229:
--------------------------------------

oops, i just noticed that i left "@timeout / 1000.0" in that patch. sorry about that. it should be left as just "@timeout".


> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-229) ruby client timeout does not affect connect()

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665561#action_12665561 ] 

Bryan Duxbury commented on THRIFT-229:
--------------------------------------

Ok, this looks good. Thanks for responding with a fix!

Unless anyone objects, I'm going to commit this change.

> ruby client timeout does not affect connect()
> ---------------------------------------------
>
>                 Key: THRIFT-229
>                 URL: https://issues.apache.org/jira/browse/THRIFT-229
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Ruby)
>         Environment: all
>            Reporter: Robey Pointer
>            Assignee: Bryan Duxbury
>         Attachments: patch-2.txt, thrift-229.patch
>
>
> the ruby library does not wrap client connect() calls in a timeout select. so a ruby thrift client could be blocked in connect() indefinitely.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.