-
Notifications
You must be signed in to change notification settings - Fork 1
clojurebridge swallos exceptions #2
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
Comments
This is quire sever, I would say. python -c 'from clojurebridge import cljbridge;cljbridge.load_clojure_file(clj_file="file.clj")' is not visible to a user. Additionaly the process hangs, it seems to me. |
Not true for all exception. But this for example:
|
To reproduce : crash.clj (ns train
(:require [libpython-clj2.python :refer [py.- py.] :as py]
[libpython-clj2.python.ffi :as ffi]))
;; [libpython-clj2.require :refer [require-python]]
;; [libpython-clj2.python.gc]
(println "-------- manual-gil: " ffi/manual-gil)
(def locked (ffi/lock-gil))
(println :gil-locked)
(println :before-crash)
(py/import-module "not existing")
(println "crash fininished") Run as embedded: python -c 'from clojurebridge import cljbridge;cljbridge.load_clojure_file(clj_file="src/crash.clj",mvn_local_repo="/home/carsten/.m2/repository")' |
I think we might be speaking past each other. I did add an api - clj-python/libpython-clj#221 (comment) (py/with-manual-gil
(println :gil-locked)
(println :before-crash)
(py/import-module "not existing")
(println "crash fininished"))
|
yes, but this does not prevent the hanging, if somebody does not use teh API. |
For me the "hanging" is a very frustrating experience for a beginner with |
The libpython-clj API has now three different Because on "first sight" none of it is needed, and the code seems to work anyway. |
Totally agreed that documentation could be updated, changed, or added. I honestly think usage.md is a bit out of date - when I get tmd updated to latest dtype (nontrivial full version change) I will circle back and spend some time on libpython-clj. |
I also would like to know what exactly is crashing honestly. Some interaction with check-gil and multiple interpreters is my best guess but I have no solid proof. If you look at the code to checkgil in libpython it does juggle some thread-specific variables. Honestly though that type of work is hard and detailed enough that I would want to be paid for it. Auditing C code and debugging that type of thing really just eats time like crazy. |
In this case the crashing is just something is trying to lock the gil when something else has it so in this case the crash is easy but the cause for for manual gil management in the first place, aside from perf, is that it reduces the crashiness of the system by quite a lot. It is that, the original crashiness, that I would still like to know more about. |
at least when using like this:
The text was updated successfully, but these errors were encountered: