You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Thomas Kho (JIRA)" <ji...@apache.org> on 2010/08/03 23:51:16 UTC

[jira] Created: (THRIFT-837) PHP accelerator bug for writes > 8k

PHP accelerator bug for writes > 8k
-----------------------------------

                 Key: THRIFT-837
                 URL: https://issues.apache.org/jira/browse/THRIFT-837
             Project: Thrift
          Issue Type: Bug
          Components: Library (PHP)
    Affects Versions: 0.2, 0.1, 0.3, 0.4
            Reporter: Thomas Kho
             Fix For: 0.3, 0.4, 0.2, 0.1


When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Commented: (THRIFT-837) PHP accelerator bug for writes > 8k

Posted by "Loreto Parisi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904999#action_12904999 ] 

Loreto Parisi commented on THRIFT-837:
--------------------------------------

If you look at TSocket Write bug
https://issues.apache.org/jira/browse/THRIFT-826

it seems to us that this patch while fixing the 8K buffer length, it breaks the TFramedTransport, so that's the reason of the TSocket read (https://issues.apache.org/jira/browse/THRIFT-347) and write bug.

If it is the case, this needs to be re-opened to further investigations.

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>            Assignee: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Commented: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Bryan Duxbury commented on THRIFT-837:
--------------------------------------

Any chance you could contribute a test case for this?

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Commented: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Bryan Duxbury commented on THRIFT-837:
--------------------------------------

I guess I was sort of imagining there being a transport unit test for the PHP library that you could enhance, but that appears not to be the case.

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Commented: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Bryan Duxbury commented on THRIFT-837:
--------------------------------------

I'm not 100% sure that I understand this patch, but I'm pretty sure it has a bug. In directWrite, you're ignoring the "data" argument and always writing the data from "buffer". This seems like it would cause an issue regardless of what length is being used.

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Assigned: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Bryan Duxbury reassigned THRIFT-837:
------------------------------------

    Assignee: Thomas Kho

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>            Assignee: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Commented: (THRIFT-837) PHP accelerator bug for writes > 8k

Posted by "Thomas Kho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897991#action_12897991 ] 

Thomas Kho commented on THRIFT-837:
-----------------------------------

Sorry about that Bryan. Sloppiness on my part. Fixed and updated the patch.

What kind of format are you looking for regarding test case? I'm not really sure how to write a programatic test for this, but there's not much to the thrift definition I used to tickle the bug:

test.thrift:

struct TestRequest {
  1: string request,
}

struct TestResponse {
  1: string response,
}

service TestService {
  TestResponse get(1: TestRequest request)
}

I used some Facebook-specific libraries for both the PHP client and C++ server. The only salient notes are that I used a buffered transport and the accelerator (TBinaryProtocolAccelerated).

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Resolved: (THRIFT-837) PHP accelerator bug for writes > 8k

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

David Reiss resolved THRIFT-837.
--------------------------------

    Resolution: Fixed

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Updated: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Thomas Kho updated THRIFT-837:
------------------------------

    Attachment: php_extension_8kbug.patch

Messed up the first patch. In my test script, I was sending both a 10kb request and response string, and only verified the contents of the response string. Because it was sending data of the right length, the request succeeded.

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Updated: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Thomas Kho updated THRIFT-837:
------------------------------

    Attachment: php_extension_8kbug.patch

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.1, 0.2, 0.3, 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Updated: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Bryan Duxbury updated THRIFT-837:
---------------------------------

    Fix Version/s:     (was: 0.1)
                       (was: 0.2)
                       (was: 0.3)

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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


[jira] Updated: (THRIFT-837) PHP accelerator bug for writes > 8k

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

Thomas Kho updated THRIFT-837:
------------------------------

    Attachment:     (was: php_extension_8kbug.patch)

> PHP accelerator bug for writes > 8k
> -----------------------------------
>
>                 Key: THRIFT-837
>                 URL: https://issues.apache.org/jira/browse/THRIFT-837
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.1, 0.2, 0.3, 0.4
>            Reporter: Thomas Kho
>             Fix For: 0.4
>
>         Attachments: php_extension_8kbug.patch
>
>
> When we write more than 8k, the output transport does a directWrite() rather than buffering, in which case we need to use the passed len value rather than the length of the buffer.

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