tyrus
  1. tyrus
  2. TYRUS-201

Wrong ServletInputStream#isReady() usage in TyrusHttpUpgradeHandler

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

              } finally {
                  if (is.isReady()) {
                      LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                  } else {
                      // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                  }
              }
      

      It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

      While isReady() returns true, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream

        Activity

        jitu created issue -
        jitu made changes -
        Field Original Value New Value
        Description [code]
                } finally {
                    if (is.isReady()) {
                        LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                    } else {
                        // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                    }
                }
        [/code]

        It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

        While isReady() *returns true*, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream
         
        [code]
                } finally {
                    if (is.isReady()) {
                        LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                    } else {
                        // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                    }
                }
        [code]

        It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

        While isReady() *returns true*, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream
         
        Pavel Bucek made changes -
        Description [code]
                } finally {
                    if (is.isReady()) {
                        LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                    } else {
                        // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                    }
                }
        [code]

        It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

        While isReady() *returns true*, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream
         
        {code}
                } finally {
                    if (is.isReady()) {
                        LOGGER.log(Level.SEVERE, "This shouldn't happen. ServletInputStream.isReady() returned true after reading all available() data.");
                    } else {
                        // everything is ok, all data consumed, waiting for next onDataAvailable call from web-core
                    }
                }
        {code}

        It is not an error that isReady() returns true. There is a window where data can be available after the call available() and before isReady() is called.

        While isReady() *returns true*, you need to loop and read the data. Otherwise, the container won't call onDataAvailable() again. See the javadoc of ServerInputStream
         
        Pavel Bucek made changes -
        Assignee Pavel Bucek [ pavel_bucek ]
        Pavel Bucek made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.3 [ 16600 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            jitu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: