fix: Resolve race condition between visited flag and result of ready postcondition by ds-akloskowski · Pull Request #2886 · operator-framework/java-operator-sdk

Fix for a problem described in #2885.

The changed code causes that when visited flag is changed to true, we are sure that readyPostconditionResult was checked before. In previous version, visited flag set to true and readyPostconditionResult equals null could describe two situations:

  1. A resource was visited and its readyPostcondition is null.
  2. A resource was visited and its readyPostcondition exists, but wasn't wasn't checked (race condition).

The changed code doesn't let the second situation to happen.