cf-java-client icon indicating copy to clipboard operation
cf-java-client copied to clipboard

`ApplicationManifestUtilsV3#write` is not threadsafe

Open LitschiW opened this issue 4 months ago • 0 comments

The method ApplicationManifestUtilsV3#write uses a static snakeyaml Yaml dumper to write all manifests into a byte array this operation is inheritly not threadsafe, as the deserializer is not.

This in itself may not a be problem. However, when using Applications#pushManifestv3 to push multiple Apps in parallel this can cause issues that manifest in the form of

  • Bad request: Manifest does not support Anchors and Aliases or
  • java.lang.NullPointerException: Nodes must be provided.

Snakeyaml recommends to create a singe instance per thread.

LitschiW avatar Oct 11 '24 14:10 LitschiW