Blade c jvm script will be repeated multiple times #150
Labels
chaosblade-cli
chaosblade project
chaosblade-exec-jvm
chaosblade-exec-jvm project
type/bug
Something isn't working
Milestone
bug report
./blade c jvm script 会重复挂载多次watch,导致script-file执行多次
通过blade 执行下面的命令多次,第一次成功,之后就报错,看起来没有任何问题。
![image](https://user-images.githubusercontent.com/22674253/62283449-291d9c80-b484-11e9-97ea-09d8d402d342.png)
![image](https://user-images.githubusercontent.com/22674253/62283598-7732a000-b484-11e9-985b-be61e125b0df.png)
![image](https://user-images.githubusercontent.com/22674253/62284489-47849780-b486-11e9-9083-2dab143e3455.png)
![image](https://user-images.githubusercontent.com/22674253/62284523-579c7700-b486-11e9-9d38-0c689a448341.png)
但是观察到脚本被调用了多次,如下图
通过阅读源代码发现,每次执行命令,都会走到com.alibaba.chaosblade.exec.bootstrap.jvmsandbox.SandboxModule#add,然后调用sandbox的watch方法添加一个listener。这步完成之后,才会走到判断重复的逻辑,返回错误信息,但是实际上已经再次通过sandbox增强了指定类。
所以判断重复的操作应该提前进行!
The text was updated successfully, but these errors were encountered: