Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Task clojureRepl fails due to race condition in PreplJava.client #161

@bluesun

Description

@bluesun

Expected Behavior

./gradlew clojureRepl shoudl start the REPL server

Current Behavior

Since upgrading to clojurephant 0.6 I had significant issues starting the REPL (using CIDER and nrepl). I could'nt start the REPL via .gradlew/clojureRepl and got the error:

$ ./gradlew cR
> Task :checkDevClojure FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':checkDevClojure'.
> Unable to connect to prepl at localhost/127.0.0.1:41255

I did solve the issue with adding randomness to the two methods involved in the race condition in PreplClient.java. Pull request will be provided.

Thanks for your work and the clojurephant plugin!

Context

This happened for me on several OS (Windows and Ubuntu) and with slow and fast laptops.

Strangely this issue appeared some time ago, I believe under clojurephant 0.5 but after a few retry it was possible the start the REPL server. After upgrading to clojurephant 0.6 (and many changes in our main application including an upgrade to Gradle 6.8) the REPL server did not start anymore regardless of the number of retries.

Only the start of the REPL server is impacted.

Steps to reproduce

It does not happen on small repositories like the ones generated by the clojurephant templates, so that I am not able to reproduce the issue in a unit test (at least with my current understanding of the plugin).

Environment

  • Build scan URL:
  • clojurephant version: 0.6.0
  • Gradle version: 6.8
  • Java version: 11.0.11
  • OS version: Ubuntu 20.04.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions