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

Babashka script with bbssh pod gets stuck on exit #14

Closed
ramonpin opened this issue Oct 25, 2023 · 1 comment
Closed

Babashka script with bbssh pod gets stuck on exit #14

ramonpin opened this issue Oct 25, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ramonpin
Copy link

While using the pod to download some files from a remote host the script does not terminate, it gets stuck at the end of the main thread code. I thought it might be due to the thread pool used by agents and added the call to (shutdown-agents). However, the script still gets stuck.

  • babashka version is 'v1.3.185'
  • bbssh pod version is 0.5.0

I have created a minimal script that reproduces the error:

(ns sample
  (:require [babashka.pods :as pods]))

(def bbsh-pod (pods/load-pod 'epiccastle/bbssh "0.5.0"))
(require '[pod.epiccastle.bbssh.core :as ssh])
(require '[pod.epiccastle.bbssh.scp :as scp])

(def user "user")
(def cert "/home/user/.ssh/id_rsa")

;; Main process
(let [session (ssh/ssh "localhost" {:username user :identity cert})
      opts {:session session}]
  (scp/scp-from "/etc/hosts" "remote-hosts" opts)
  (shutdown-agents)
  (println "shutdown"))

The script actually downloads the file, but does not terminate. Killing the pod manually with (pods/unload-pod bbsh-pod) doesn't work either, it blocks on this call also.

@retrogradeorbit retrogradeorbit self-assigned this Nov 27, 2023
@retrogradeorbit retrogradeorbit added the bug Something isn't working label Nov 27, 2023
@retrogradeorbit
Copy link
Member

The fix has been released in version 0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants