[jira] [Created] (FLINK-3014) Return code from InputStream#read() should be checked in PythonStreamer#sendBroadCastVariables

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-3014) Return code from InputStream#read() should be checked in PythonStreamer#sendBroadCastVariables

Shang Yuanchun (Jira)
Ted Yu created FLINK-3014:
-----------------------------

             Summary: Return code from InputStream#read() should be checked in PythonStreamer#sendBroadCastVariables
                 Key: FLINK-3014
                 URL: https://issues.apache.org/jira/browse/FLINK-3014
             Project: Flink
          Issue Type: Bug
            Reporter: Ted Yu
            Priority: Minor


Here is related code (there're 3 occurrences in the method):
{code}
      in.read(buffer, 0, 4);
      checkForError();
{code}
java.io.InputStream.read(byte[], int, int) returns the number of bytes read.
The return value should be checked because checkForError() does this:
{code}
    if (getInt(buffer, 0) == -2) {
      try { //wait before terminating to ensure that the complete error message is printed
{code}
Incorrect result may be returned if fewer than 4 bytes of data are read.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)