Uploaded image for project: 'Apache DirectMemory'
  1. Apache DirectMemory
  2. DIRECTMEMORY-73

NPE on put method in CacheServiceImpl when cache is full.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.1-incubating
    • None
    • None

    Description

      If cache is full, and try doing a put with no buffer space left available (i.e. cache is full) so a null pointer is returned from the memorymanager, this is then put into the hashmap holding keys and values, thus causing npe.

      Solutions proposed to fix this:
      When null is returned from memory manager on allocation we dont put into the key pointer map, and return null.

      Questions to pose for how we want behaviour:
      If key already exists in cache (i.e. update) do we want to remove existing key/pointer (as obviously user wants a new value), and thus avoids incorrect data presented.
      Or by returning null to the user we expect them to know that update failed and existing pointer /data will be kept.
      Or finally we allow behaviour configurable?

      Attachments

        1. DIRECTMEMORY-73.patch
          3 kB
          Michael André Pearce

        Activity

          People

            olamy Olivier Lamy
            teaandcoffee Michael André Pearce
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: