Skip to content

Multi thread concurrent bug #11

@chengnl

Description

@chengnl

Threads with the first number of cases, the “groupKey” value will be overwritten, leading to key group the loss of information, update again, after the corresponding value of key cannot be updated.

The code in the MemcachedClientWrapper problem:

           Set<String> group = getGroup(groupKey);
        group.add(keyString);

        if (LOG.isDebugEnabled()) {
            LOG.debug("Insert/Updating object ("
                    + groupKey
                    + ", "
                    + group
                    + ")");
        }

       storeInMemcached(groupKey, group);

"Groups" will be covered in the multi thread concurrent conditions, resulting in the first "keyString" lost:

    if (groups == null) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Group '"
                    + groupKey
                    + "' not previously stored");
        }
        return new HashSet<String>();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions