Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Fix process killing on modern java versions (using PID API introduced…
Browse files Browse the repository at this point in the history
… in Java 9 instead of reflection that's no longer allowed). Fixes #207
  • Loading branch information
flosell committed Jun 12, 2021
1 parent 201a3f8 commit 9f5fbb3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ This changelog contains a loose collection of changes in every release. I will a

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to a "shifted" version of semantic versioning while the major version remains at 0: Minor version changes indicate breaking changes, patch version changes should not contain breaking changes.

## 0.14.7

### Fixed

* Fix process killing that did not work in modern Java versions (#207)

## 0.14.6

### Fixed
Expand Down
8 changes: 2 additions & 6 deletions src/clj/lambdacd/steps/shell.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[me.raynes.conch.low-level :as sh]
[clojure.core.async :as async]
[lambdacd.util.internal.temp :as temp-util]
[lambdacd.stepsupport.output :as output]
[lambdacd.util.internal.reflection :as reflection-util])
[lambdacd.stepsupport.output :as output])
(:import (java.util UUID)
(java.io IOException)
(com.jezhumble.javasysmon JavaSysMon)))
Expand All @@ -18,11 +17,8 @@
(zero? exit-code) :success
:default :failure))

(defn- pid-of-process [proc]
(reflection-util/private-field proc "pid"))

(defn- kill [was-killed-indicator proc ctx]
(let [pid (pid-of-process proc)]
(let [pid (.pid proc)]
(reset! was-killed-indicator true)
(async/>!! (:result-channel ctx) [:processed-kill true])
(.destroy proc)
Expand Down
6 changes: 0 additions & 6 deletions src/clj/lambdacd/util/internal/reflection.clj

This file was deleted.

0 comments on commit 9f5fbb3

Please sign in to comment.