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

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.2.3.GA, 3.3.0.Beta1
    • 3.2.2.GA
    • None

      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

              dlloyd@redhat.com David Lloyd
              sdouglas1@redhat.com Stuart Douglas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: