Skip to content

process hanging in embeded mode on exception #233

Open
@behrica

Description

@behrica

As a FUP of #221 which provided a new pathway to see the exception,
but does not prevent the "hanging" in an other pathway.

The simplest scenario is that we have a hanging python process by using this clojure code crash.clj

(ns train
  (:require [libpython-clj2.python :refer [py.- py.] :as py]
            [libpython-clj2.python.ffi :as ffi]))

(def locked (ffi/lock-gil))
(py/import-module "not existing")

and load it in embedded mode using manual-gil via:

export JDK_JAVA_OPTIONS="-Dlibpython_clj.manual_gil=true"
python -c 'from clojurebridge import cljbridge;cljbridge.load_clojure_file(clj_file="crash.clj")'

The exception thrown by python on the last line in crash.clj is swallowed by either clojurebridge or libpython-clj and the process hangs forever.

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