The runtime implementation of AutoRestBaseUrl for retrieval of the URL is not thread safe, since it results in the iteration on and clearing of a hashmap without putting the iterate and clear in a critical section. This manifests itself specifically in the scenario where someone is using a custom BaseUrl template and running a parallel application (say, create multiple files in ADLS in parallel).
From the customer who encountered this issue:
The exception is coming from the line where it is looping over the entryset:
for (Map.Entry<CharSequence, String> entry : mappings.entrySet()) {
Right after that loop it calls mappings.clear() so if the RequestFactory is shared by multiple threads (which I think it is), then one thread could be iterating over the set, which another calls mappings.clear().
The runtime implementation of AutoRestBaseUrl for retrieval of the URL is not thread safe, since it results in the iteration on and clearing of a hashmap without putting the iterate and clear in a critical section. This manifests itself specifically in the scenario where someone is using a custom BaseUrl template and running a parallel application (say, create multiple files in ADLS in parallel).
From the customer who encountered this issue:
The exception is coming from the line where it is looping over the entryset:
for (Map.Entry<CharSequence, String> entry : mappings.entrySet()) {
Right after that loop it calls mappings.clear() so if the RequestFactory is shared by multiple threads (which I think it is), then one thread could be iterating over the set, which another calls mappings.clear().