Interrupt dispatch thread in WorkerAction.stop() to unblock blocking work actions

When WorkerAction.stop() is called (e.g. due to task timeout), it signalled
the main execute thread via completed.countDown() but never interrupted the
dispatch thread that is actually running the work action. With process isolation,
the worker JVM cannot exit while that non-daemon dispatch thread is alive, so
DefaultWorkerProcess.waitForStop() blocks for the full duration of any blocking
call inside the work action (e.g. CountDownLatch.await(90s)), causing
TaskTimeoutIntegrationTest to exceed its 60s @IntegrationTestTimeout.

Fix: track the dispatch thread in runningThread (guarded by runningThreadLock).
stop() now sets stopped=true and interrupts runningThread if it is set, causing
any interruptible blocking call in the work action to throw InterruptedException.
run() sets runningThread before executing the action and clears it in a finally
block. It also checks stopped after setting runningThread to handle the race
where stop() ran before run() had a chance to set the field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 file changed
tree: 6993c7ada706daa97c7f6297610bd04aa71ffa0d
  1. .github/
  2. .idea/
  3. .teamcity/
  4. architecture/
  5. build-logic/
  6. build-logic-commons/
  7. build-logic-settings/
  8. contributing/
  9. gradle/
  10. images/
  11. packaging/
  12. platforms/
  13. subprojects/
  14. testing/
  15. .coderabbit.yaml
  16. .editorconfig
  17. .gitattributes
  18. .gitignore
  19. .mailmap
  20. AI_POLICY.md
  21. build.gradle.kts
  22. CONTRIBUTING.md
  23. gradle.properties
  24. gradlew
  25. gradlew.bat
  26. KEYS.md
  27. LICENSE
  28. README.md
  29. released-versions.json
  30. settings.gradle.kts
  31. version.txt
README.md

🐘 Gradle Build Tool

Gradle is a highly scalable build automation tool designed to handle everything from large, multi-project enterprise builds to quick development tasks across various languages. Gradle’s modular, performance-oriented architecture seamlessly integrates with development environments, making it a go-to solution for building, testing, and deploying applications on Java, Kotlin, Scala, Android, Groovy, C++, and Swift.

For a comprehensive overview, please visit the official Gradle project homepage.


πŸš€ Getting Started

Starting with Gradle is easy with these essential resources. Follow these to install Gradle, set up initial projects, and explore supported platforms:

πŸ“˜ Explore Gradle’s full array of resources through the Gradle Documentation.


πŸ›  Seamless IDE & CI Integration

Gradle is built to work smoothly with a variety of Integrated Development Environments (IDEs) and Continuous Integration (CI) systems, providing extensive support for a streamlined workflow:


πŸŽ“ Learning Resources for Gradle

Kickstart your Gradle knowledge with courses, guides, and community support tailored to various experience levels:

  • DPE University Free Courses: A collection of hands-on courses for learning Gradle, complete with project-based tasks to improve real-world skills.
  • Gradle Community Resources: Discover a range of resources, tutorials, and guides to support your Gradle journey, from foundational concepts to advanced practices.

πŸ’¬ Community Support & Resources

The Gradle community offers a range of forums, documentation, and direct help to guide you through every step of your Gradle journey:

  • Documentation: The Gradle User Manual covers everything from basic to advanced configurations.
  • Community Forum: Engage with others on the Gradle Forum for discussions, tips, and best practices.
  • Community Slack: Join our Slack Channel for real-time discussions, with specialized channels like #github-integrations for integration topics.
  • Newsletter: Subscribe to the Gradle Newsletter for news, tutorials, and community highlights.

Quick Tip: New contributors to Gradle projects are encouraged to ask questions in the Slack #community-support channel.


🌱 Contributing to Gradle

  • Contribution Guide: Contribute to Gradle by submitting patches or pull requests for code or documentation improvements.
  • Code of Conduct: Gradle enforces a Code of Conduct to ensure a welcoming and supportive community for all contributors.

πŸ”— Additional Resources

To make the most out of Gradle, take advantage of these additional resources:

🌟 Stay connected with the Gradle Community and access the latest news, training, and updates via Slack, Forum, and our Newsletter.