You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kurt Huwig (JIRA)" <ji...@apache.org> on 2007/06/02 21:37:15 UTC
[jira] Created: (DERBY-2747) Reply incorrectly handles read()
returning -1
Reply incorrectly handles read() returning -1
---------------------------------------------
Key: DERBY-2747
URL: https://issues.apache.org/jira/browse/DERBY-2747
Project: Derby
Issue Type: Bug
Components: Network Client
Affects Versions: 10.2.2.0
Reporter: Kurt Huwig
Priority: Minor
If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-2747:
----------------------------------
Derby Info: (was: [Patch Available])
Kurt I am having a bit of trouble applying your patch. I get an error that Reply.java.orig does not exist.
Did you generate the patch with svn diff?
Looking at the patch without applying, I have the following nits:
I prefer if (actualBytesRead > 0) rather than if (0 < actualBytesRead).
It would be good to include the jira issue number //DERBY-2747 and a brief comment about the change with the changed code.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611312#action_12611312 ]
Kurt Huwig commented on DERBY-2747:
-----------------------------------
I just signed the ICLA and will fax it tomorrow.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kurt Huwig updated DERBY-2747:
------------------------------
Attachment: patch-2747-2.diff
svn diff would have been too easy...I made it the old hard way by manually diffing. The new patch was my by svn diff.
I made the change to the if - we code it the other way round as it is faster to understand. In this example is makes not much difference, but think of a 3-liner with '!= null' at the end.
I added a brief comment describing the reason for the 'if' and the Jira issue.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617543#action_12617543 ]
Kathey Marsden commented on DERBY-2747:
---------------------------------------
I want to finally commit this change but I was wondering Kurt if you know how to invoke the message that has the wrong number of bytes. It would be good to check in a test case along with the change.
Kathey
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-2747:
----------------------------------
Derby Categories: [High Value Fix]
This looks like it is still an issue. Patch just needs testing and commit. I don't think we need an ICLA for this.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden resolved DERBY-2747.
-----------------------------------
Resolution: Fixed
Fix Version/s: 10.5.0.0
Assignee: Kurt Huwig
Thanks Kurt for the patch. Sorry it took so long to get committed.
Committed revision 680767.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Assignee: Kurt Huwig
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kurt Huwig updated DERBY-2747:
------------------------------
Attachment: patch-2747-1.diff
This patch probably fixes the problem - I am unable to test it. I wrote it in a way that should be robust against future changes like adding "continue" to the loop.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516469 ]
Kathey Marsden commented on DERBY-2747:
---------------------------------------
Kurt said
>1) no, I cannot get the testing working.
Double check your ant.properties that j13lib and, j14lib are set to valid locations.
>2) I'd love to, but I currently do not have access to a fax machine.
You can send it snail mail. There is an address on the form.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617706#action_12617706 ]
Kurt Huwig commented on DERBY-2747:
-----------------------------------
Kathey,
the EOF happens when a client closes the connection while talking to a Derby network server. To reproduce it, you'd have to write a custom Derby network client, that closes a connection in the middle of a conversation. For me it happened when the Derby server was heavily overloaded and clients were stopped.
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504855 ]
Kathey Marsden commented on DERBY-2747:
---------------------------------------
Thanks Kurt. The patch looks good. I have a couple more questions before I commit.
1) Did you run tests?
2) Have you filed an ICLA? It is probabably not needed for this small patch, but definitely a good idea for all contributors. See http://wiki.apache.org/db-derby/DerbyContributorChecklist
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2747) Reply incorrectly handles read()
returning -1
Posted by "Kurt Huwig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504895 ]
Kurt Huwig commented on DERBY-2747:
-----------------------------------
1) no, I cannot get the testing working. I guess it is due to having JDK 1.6 here:
compile:
[javac] Compiling 45 source files to /home/kurt/Projekte/Derby/10.2/classes
[javac] /home/kurt/Projekte/Derby/10.2/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java:412: cannot access java.lang.AssertionError
[javac] class file for java.lang.AssertionError not found
[javac] try {
[javac] ^
BUILD FAILED
/home/kurt/Projekte/Derby/10.2/build.xml:368: The following error occurred while executing this line:
/home/kurt/Projekte/Derby/10.2/java/testing/build.xml:61: The following error occurred while executing this line:
/home/kurt/Projekte/Derby/10.2/java/testing/org/apache/derbyTesting/functionTests/util/build.xml:57: Compile failed; see the compiler error output for details.
2) I'd love to, but I currently do not have access to a fax machine. I did not expect to deserve this honor, but I hope to be able to contribute more patches
> Reply incorrectly handles read() returning -1
> ---------------------------------------------
>
> Key: DERBY-2747
> URL: https://issues.apache.org/jira/browse/DERBY-2747
> Project: Derby
> Issue Type: Bug
> Components: Network Client
> Affects Versions: 10.2.2.0
> Reporter: Kurt Huwig
> Priority: Minor
> Attachments: patch-2747-1.diff, patch-2747-2.diff
>
>
> If java/client/org/apache/derby/client/net/Reply.java encounters a EOF, i.e. reads -1 then it adds this value to the number of bytes read and prints an error message which reads "-1 bytes read".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.