Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0, 2.1.0, 2.2.0
Description
config() is called in multiple threads. But ArtifactoryConfigLoader.load is not thread-safe. For example, https://github.com/apache/storm/blob/master/storm-server/src/main/java/org/apache/storm/scheduler/utils/ArtifactoryConfigLoader.java#L181-L187
JSONObject returnValue; try { returnValue = (JSONObject) jsonParser.parse(metadataStr); } catch (ParseException e) { LOG.error("Could not parse JSON string {}", metadataStr, e); return null; }
Multiple threads use the same jsonParser and since JsonParser is not thread-safe, the return value will be corrupted.
I propose to create a separate thread to load scheduler configs periodically. This also makes the config loading logic cleaner.
Attachments
Issue Links
- links to