Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-7757

Possible Atomicity Violations in StreamSession and ThriftSessionManager

    XMLWordPrintableJSON

    Details

    • Severity:
      Low

      Description

      I'm developing a tool for atomicity violation detection and I think it have found two atomicity violations in cassandra.

      In org.apache.cassandra.streaming.StreamSession there might be an atomicity violation in method addTransferFiles(), lines 310-314:

      310:     StreamTransferTask task = transfers.get(cfId);
                  if (task == null)
                  {
                      task = new StreamTransferTask(this, cfId);
      314:         transfers.put(cfId, task);
                  }
      

      A concurrent thread can insert a transfer with the same uuid creating two StreamTransferTask, and only one get into "transfers".

      In org.apache.cassandra.thrift.ThriftSessionManager, a simular situation can occur in method currentSession(), lines 57-61:

      57:  ThriftClientState cState = activeSocketSessions.get(socket);
              if (cState == null)
              {
                  cState = new ThriftClientState(socket);
      51:       activeSocketSessions.put(socket, cState);
              }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pauloricardomg Paulo Motta
                Reporter:
                orium Diogo Sousa
                Authors:
                Paulo Motta
                Reviewers:
                Yuki Morishita
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: