Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

CloudStorageFileSystem: ConcurrentModificationException belies thread safety #691

@cjllanwarne

Description

@cjllanwarne

We recently updated from an older version of the storage NIO library and are now seeing ConcurrentModificationExceptions from CloudStorageFileSystem. At a guess, it seems like this function is perhaps not perfectly resilient if CONFIG_TO_PROVIDERS_MAP is updated while the existingProviders value is being iterated over?

Caused by: java.util.ConcurrentModificationException: null
	at java.base/java.util.HashMap$HashIterator.nextNode(Unknown Source)
	at java.base/java.util.HashMap$KeyIterator.next(Unknown Source)
	at com.google.cloud.storage.contrib.nio.CloudStorageFileSystem.getCloudStorageFileSystemProvider(CloudStorageFileSystem.java:164)
	at com.google.cloud.storage.contrib.nio.CloudStorageFileSystem.forBucket(CloudStorageFileSystem.java:196)
	at [...our client code]

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/java-storage-nio API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions