Skip to content

Commit

Permalink
fix: if jvm restart run experiment error
Browse files Browse the repository at this point in the history
Signed-off-by: tiny.x <[email protected]>
  • Loading branch information
tiny-x committed Mar 19, 2021
1 parent 4c8245d commit 0d0d547
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean

export BLADE_VERSION=0.9.0
export BLADE_VERSION=0.10.0

ALLOWGITVERSION=1.8.5
GITVERSION:=$(shell git --version | grep ^git | sed 's/^.* //g')
Expand Down
10 changes: 9 additions & 1 deletion exec/jvm/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ func (e *Executor) Exec(uid string, ctx context.Context, model *spec.ExpModel) *
suid, isDestroy := spec.IsDestroy(ctx)
record, err := e.getRecordFromDB(processName, processId)

var port string
var port, pid string
if record != nil {
port = record.Port
pid = record.Pid
}

if isDestroy {
Expand Down Expand Up @@ -113,6 +114,13 @@ func (e *Executor) Exec(uid string, ctx context.Context, model *spec.ExpModel) *
return response
}
}

// jvm restart case
if exists, _ := cl.ProcessExists(pid); !exists && port != "" {
logrus.Infof("pid %s not exists", pid)
port = ""
}

// Install java agent
if port == "" || override {
logrus.Info("Install java agent")
Expand Down

0 comments on commit 0d0d547

Please sign in to comment.