java.util.ConcurrentModificationException in DefaultDockerClientConfig.replaceProperties · Issue #2274 · docker-java/docker-java · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

java.util.ConcurrentModificationException in DefaultDockerClientConfig.replaceProperties #2274

Closed
@lyndsey-ferguson

Description

@lyndsey-ferguson

We are seeing an occasional exception when calling DefaultDockerClientConfig.createDefaultConfigBuilder():

java.util.ConcurrentModificationException: (No message provided)    
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52)    
at com.github.dockerjava.core.DefaultDockerClientConfig.replaceProperties(DefaultDockerClientConfig.java:133)    
at com.github.dockerjava.core.DefaultDockerClientConfig.replaceProperties(DefaultDockerClientConfig.java:128)    
at com.github.dockerjava.core.DefaultDockerClientConfig.loadIncludedDockerProperties(DefaultDockerClientConfig.java:121)    
at com.github.dockerjava.core.DefaultDockerClientConfig.createDefaultConfigBuilder(DefaultDockerClientConfig.java:217)    
at com.github.dockerjava.core.DefaultDockerClientConfig.createDefaultConfigBuilder(DefaultDockerClientConfig.java:210) 

I think this is an inherent problem in how the code works. It is replacing values for a Properties() instance as it is iterating over it with an "enhanced for" loop using an iterator created via the property's keySet() method.

That causes a problem:

If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.

For each KEY in the keySet, we call properties.setProperty with the KEY and the matching string ${KEYVALUE} for the value given by a replacements Properties instance. That is to say, we are replacing each property that has an entry in the replacements.

Here is where the Hashtable is being modified while it is being iterated on (and not using the remove method) in this code:

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

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.