You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Kevin Ballard (JIRA)" <ji...@apache.org> on 2008/07/10 23:40:32 UTC

[jira] Created: (THRIFT-74) Thrift::Socket#read should accept optional timeout argument

Thrift::Socket#read should accept optional timeout argument
-----------------------------------------------------------

                 Key: THRIFT-74
                 URL: https://issues.apache.org/jira/browse/THRIFT-74
             Project: Thrift
          Issue Type: New Feature
          Components: Library (Ruby)
            Reporter: Kevin Ballard
            Priority: Minor
         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch

Thrift::Socket#read should accept an optional timeout argument which will raise an TransportException if no data was returned in that time period.

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


[jira] Commented: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard commented on THRIFT-74:
-------------------------------------

Do we feel this is necessary? Ruby's built-in timeout on connect seems perfectly adequate to me.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Commented: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612723#action_12612723 ] 

David Reiss commented on THRIFT-74:
-----------------------------------

I think this works better as a property (or getter/setter) than a constructor argument, though I don't know Ruby so maybe it is already a public member and I just can't tell :).  Also, remember that you also have to set timeouts on connect and send in order to be able to make any guarantees.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Updated: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard updated THRIFT-74:
--------------------------------

    Attachment: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch

This patch now implements the timeout on write as well.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Updated: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard updated THRIFT-74:
--------------------------------

    Description: Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.  (was: Thrift::Socket#read should accept an optional timeout argument which will raise an TransportException if no data was returned in that time period.)
     Patch Info:   (was: [Patch Available])
        Summary: Thrift::Socket.new should accept optional timeout argument  (was: Thrift::Socket#read should accept optional timeout argument)

Good idea.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Updated: (THRIFT-74) Thrift::Socket#read should accept optional timeout argument

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

Kevin Ballard updated THRIFT-74:
--------------------------------

    Attachment: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch

> Thrift::Socket#read should accept optional timeout argument
> -----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket#read should accept an optional timeout argument which will raise an TransportException if no data was returned in that time period.

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


[jira] Commented: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard commented on THRIFT-74:
-------------------------------------

It does indeed expose timeout as an instance variable with an accessor, so you can set it or change it after the Socket has been created.

I believe connect already times out, natively. I'm not aware of any way to control this timeout, though. I can implement timeout for write, but unfortunately this will break jruby compatibility (jruby doesn't implement the IO#foo_nonblock methods properly).

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Updated: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard updated THRIFT-74:
--------------------------------

    Patch Info: [Patch Available]

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Commented: (THRIFT-74) Thrift::Socket#read should accept optional timeout argument

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

Bryan Duxbury commented on THRIFT-74:
-------------------------------------

I don't think it should be on Socket#read. I think it should be part of the Socket constructor.

> Thrift::Socket#read should accept optional timeout argument
> -----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket#read should accept an optional timeout argument which will raise an TransportException if no data was returned in that time period.

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


[jira] Commented: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612776#action_12612776 ] 

David Reiss commented on THRIFT-74:
-----------------------------------

The way we implement timeouts in the C++ TSocket is to set the socket nonblocking, call connect, expect an error return with errno == EINPROGRESS, poll(2) the socket with a timeout for writeability, and fail if the timeout occurs.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Updated: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Ballard updated THRIFT-74:
--------------------------------

    Attachment: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch

Attached new version of the patch

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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


[jira] Closed: (THRIFT-74) Thrift::Socket.new should accept optional timeout argument

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

Kevin Clark closed THRIFT-74.
-----------------------------

    Resolution: Fixed

In 678053.

> Thrift::Socket.new should accept optional timeout argument
> ----------------------------------------------------------
>
>                 Key: THRIFT-74
>                 URL: https://issues.apache.org/jira/browse/THRIFT-74
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Ruby)
>            Reporter: Kevin Ballard
>            Priority: Minor
>         Attachments: 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch, 0001-rb-Add-optional-timeout-argument-to-Thrift-Socket.patch
>
>
> Thrift::Socket.new should accept an optional timeout argument which will raise an TransportException if no data was returned during a #read in that time period.

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