Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-810

DIRMINA-803 ProtocolCodecFilter.filterWrite() is no longer thread-safe not fixed totally

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Filter
    • Labels:
      None

      Description

      Hi,I notice DIRMINA-803 https://issues.apache.org/jira/browse/DIRMINA-803 sayed ProtocolEncoderOutputImpl.flush(). also has same question as ProtocolCodecFilter.filterWrite().
      I checked the source at http://svn.apache.org/viewvc?view=revision&revision=1023759
      found two places line 427 and line 452 also has same question
      423 public void flush(NextFilter nextFilter, IoSession session) {
      424 Queue<Object> messageQueue = getMessageQueue();
      425
      426 while (!messageQueue.isEmpty())

      { 427 nextFilter.messageReceived(session, messageQueue.poll()); 428 }

      from 426 may should as follows
      while (!messageQueue.isEmpty()) {
      Object encodedMessage = messageQueue.poll();
      if (encodedMessage == null)

      { break; }

      nextFilter.messageReceived(session, encodedMessage.poll());
      }

      and
      451 while (!bufferQueue.isEmpty()) {
      452 Object encodedMessage = bufferQueue.poll();
      453
      454 // Flush only when the buffer has remaining.
      455 if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining()) {

      at line 453 should insert
      if (encodedMessage == null)

      { break; }

        Attachments

          Activity

            People

            • Assignee:
              elecharny Emmanuel L├ęcharny
              Reporter:
              charley charley
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: