Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-1579

NPE on some operations after calling removeNode on an unexistent FQN

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1.0.GA, 3.2.0.GA, 3.2.1.GA, 3.2.2.GA, 3.2.3.GA
    • Fix Version/s: 3.2.4.GA
    • Component/s: Locking
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use read committed instead of repeteable read.
      If must use repeteable read, add checks whether FQN exists before calling clearData or remote(fqn, key)

      Show
      Use read committed instead of repeteable read. If must use repeteable read, add checks whether FQN exists before calling clearData or remote(fqn, key)

      Description

      NullPointerException can be thrown when you call removeNode on a non-existing FQN and then call clearData on that FQN, clearData throws an NPE, i.e.

      java.lang.NullPointerException
      at org.jboss.cache.invocation.NodeInvocationDelegate.clearDataDirect(NodeInvocationDelegate.java:243)
      at org.jboss.cache.commands.write.ClearDataCommand.perform(ClearDataCommand.java:79)
      at org.jboss.cache.interceptors.CallInterceptor.invokeCommand(CallInterceptor.java:108)
      at org.jboss.cache.interceptors.CallInterceptor.handleAlterCacheMethod(CallInterceptor.java:173)
      at org.jboss.cache.interceptors.CallInterceptor.visitClearDataCommand(CallInterceptor.java:149)
      at org.jboss.cache.commands.write.ClearDataCommand.acceptVisitor(ClearDataCommand.java:86)
      at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.jboss.cache.interceptors.EvictionInterceptor.visitClearDataCommand(EvictionInterceptor.java:235)
      at org.jboss.cache.commands.write.ClearDataCommand.acceptVisitor(ClearDataCommand.java:86)
      at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.jboss.cache.interceptors.MVCCLockingInterceptor.handleClearDataCommand(MVCCLockingInterceptor.java:124)
      at org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor.visitClearDataCommand(PrePostProcessingCommandInterceptor.java:167)
      at org.jboss.cache.commands.write.ClearDataCommand.acceptVisitor(ClearDataCommand.java:86)

      The same thing would occur if you called remove(fqn, key) after calling removeNode(fqn) on an unexistent FQN.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  galder.zamarreno Galder ZamarreƱo
                  Reporter:
                  galder.zamarreno Galder ZamarreƱo
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: