Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to avoid This property is in an unexpected state errors #294

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

CRogers
Copy link
Contributor

@CRogers CRogers commented Feb 23, 2024

Before this PR

Internally, we are seeing a lot of errors with #286 of this form:

Execution failed for task ':blah:blah:javadoc'.
> Failed to calculate the value of property 'distributionName'.
   > This property is in an unexpected state.

I think this is similar to what we encountered in #51. baseline-java-versions/Gradle gets JDKs in parallel on different threads. Gradle really isn't set up to handle this multi-threading, especially when it comes to finalizing property values. Gradle even has this comment:

// TODO - it is currently possible for multiple threads to finalize a property instance concurrently (gradle/gradle#12811)

I think when making stuff finalizeValueOnRead we now encounter this bug.

After this PR

==COMMIT_MSG==
Try to avoid This property is in an unexpected state errors
==COMMIT_MSG==

We do this by not doing finalizeValueOnRead.

I also removed some of the "extra" laziness I introduced in the previous PR. This extra laziness gave more places where this property could be finalised on different threads, and I don't think we need the extra laziness (or at least did fine without it before).

Possible downsides?

I can't repro this locally. It seems to happen on <1% of builds according to the build scan server. So no tests, this is purely an educated guess whether it will fix this.

@changelog-app
Copy link

changelog-app bot commented Feb 23, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Try to avoid This property is in an unexpected state errors

Check the box to generate changelog(s)

  • Generate changelog entry

@CRogers CRogers marked this pull request as ready for review February 23, 2024 13:31
@bulldozer-bot bulldozer-bot bot merged commit 374ca36 into develop Feb 23, 2024
6 checks passed
@bulldozer-bot bulldozer-bot bot deleted the callumr/avoid-unexpected-state branch February 23, 2024 14:04
@svc-autorelease
Copy link
Collaborator

Released 0.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants