arrow-kt / suspendapp

Reason about resource-safety in the same way you reason about Structured Concurrency with SuspendApp!
https://arrow-kt.github.io/suspendapp/
Apache License 2.0
74 stars 7 forks source link

Gradle Ctrl-C Not Terminating Ktor SuspendApp #110

Open jamesward opened 10 months ago

jamesward commented 10 months ago

Repro Steps: https://github.com/jamesward/kmp-conf-server

./gradlew runDebugExecutableLinuxX64

(Not sure if the same problem exists on Mac)

Hit Ctrl-C and see the Gradle process end, but the native server process continues running even after multiple minutes:

$ ps auxwww|grep kmp-conf-server
jw        847540  0.1  0.0 554808 28072 ?        Sl   16:09   0:00 /home/jw/projects/kmp-conf-server/build/bin/linuxX64/debugExecutable/kmp-conf-server.kexe
i-walker commented 10 months ago

This might be related to #109 cc @nomisRev

nomisRev commented 10 months ago

Hey @jamesward,

Thanks for your support & interest in this project. As far as I know this is a Gradle issue, where the SIGINT signal is not properly propagated to the running forked processes.

If you know some fix we can apply to our side, or add some Gradle documentation on how to fix this that'd be awesome.

Some references: