Uploaded image for project: 'JBoss Remoting (3+)'
  1. JBoss Remoting (3+)
  2. REM3-145

Messages can get lost if two threads attempt to send on the same channel at the same time

    XMLWordPrintable

    Details

      Description

      This can occur if there is a random number collision, which is actually not as unlikely as it sounds. Because Random() uses a volatile and not an Atomic long to create the seed, it is possible for two threads to end up with the exact same seed. I could reproduce this close to 100% of the time when using 3 threads that all attempt to send at the same time.

      Potential fix is here, although using putIfAbsent may be better:

      https://github.com/stuartwdouglas/jboss-remoting/commit/14c6c7cb91700dd8340ec8f141b373f6203f77b5

        Attachments

          Activity

            People

            Assignee:
            dmlloyd David Lloyd
            Reporter:
            swd847 Stuart Douglas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: