Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1568

AbstractFramedChannel.toString() is not synchronized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.0.40.Final, 2.2.11.Final
    • 2.0.22.Final
    • None
    • None

      When trying to log a WebSocketChannel (toString()), I get:

      SLF4J: Failed toString() invocation on an object of type [io.undertow.websockets.core.protocol.version13.WebSocket13Channel]
      Reported exception:
      java.util.ConcurrentModificationException
      	at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
      	at java.util.LinkedList$ListItr.next(LinkedList.java:888)
      	at java.util.AbstractCollection.toString(AbstractCollection.java:461)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel.toString(AbstractFramedChannel.java:1097)
      
      

      AbstractFramedChannel.toString() looks like this:

         @Override
          public String toString() {
              return getClass().getSimpleName() + " peer " + channel.getPeerAddress() + " local " + channel.getLocalAddress() + "[ " + (receiver == null ? "No Receiver" : receiver.toString()) + " " + pendingFrames.toString() + " -- " + heldFrames.toString() + " -- " + newFrames.toString() + "]";
          }
      

      I noticed that List<S> pendingFrames is always used in synchronized blocks... shouldn't toString() be synchronized, too?

            rhn-cservice-bbaranow Bartosz Baranowski
            samo.dadela Samo Dadela (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: