avast/gradle-docker-compose-plugin

JavaExec does not exit properly when interrupted with container logging enabled and no output from a container

開放

#242 建立於 2020年6月11日

 (3 則留言) (0 個反應) (0 位負責人)Groovy (103 個分叉)batch import
help wantedquestion

倉庫指標

星標
 (429 顆星)
PR 合併指標
 (平均合併 24天 11小時) (30 天內合併 2 個 PR)

描述

Long running JavaExec processes are left running when used with docker compose if the following happens:

  1. The process is long running
  2. The docker-compose stanza in gradle attempts to log the container output using one of
    • captureContainersOutput
    • captureContainersOutputToFile
  3. The container doesn't actually produce any output
    • Ran into this with the memcached container specifically

The following demonstrates the issue:

  1. Execute ./gradlew run to start
    • Web server that is long running
    • Has capture output statements in the docker-compose stanza
    • Uses memcached in the associated docker-compose file
  2. Inspect the process list
    • See that the process is running
  3. Interrupt gradle with ctrl-c
  4. Inspect the process list again
    • Notice that the process is still running
    • The process doesn't exit

Not sure how much of this is relevant but adding it in case it's useful:

  • O/S is Ubuntu 18.04
  • OpenJDK 11 from the O/S
  • Happens on the command line and when invoked with IntelliJ
  • Interestingly, doesn't seem to be an issue when gradle/the application is run in debug mode

I'm happy to provide more detail or information as required.

貢獻者指南