I have a gitlab CI pipeline defined in .gitlab-ci.yml. One job is to deploy and start a spring boot application to 2 different machines. I do it by invoking a bash script twice with different machine set as argument to the script, and in the script it will start the spring boot application (already copied to the machine) using ssh command.
A weird thing is that if I have only one machine, this pipeline works fine. However, when I have 2 machines (with 2 invocations of the script as described above), the spring boot application deployed to the first machine will STALL. The process is still there, I can connect to it via visualVM to see the threads are running, but will just do nothing. No response from the http endpoint, no more logs produced at all.
I looks like something happened when the second invocation is started. However, the second invocation goes to the other machine, shouldn't have any impact on the first machine.
Much appreciated if anyone can share any hint of this.
Thanks!