metalbear-co / mirrord-intellij

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
11 stars 10 forks source link

Tomcat runs mirrord twice, incompatible with scaledown #280

Closed aviramha closed 2 months ago

aviramha commented 2 months ago

Bug Description

when user uses tomcat they get the mirrord launch triggered twice for some reason - this isn't so bad, unless using scaledown then one fails because of conflict

Steps to Reproduce

couldn't reproduce IntelliJ IDEA 2023.1.6 Tomcat 7.0.105

Backtrace

No response

Relevant Logs

No response

Your operating system and version

macos

Local process

tomcat

Local process version

No response

Additional Info

No response

aviramha commented 2 months ago

This issue also happens with tasks that happen before launch, triggering another plugin entrypoint. Perhaps we should add a check if env for mirrord is already set, and if so, skip? (hoping that env is passed between the executions)

DmitryDodzin commented 2 months ago

@aviramha Do we want to prevent the execution from the plugin or should the cli be able to be called exec twice where only the first execution creates agent and intproxy and second one reuses them?

aviramha commented 2 months ago

I think we should have something similar to what we have in VSCode - if we see env already manipulated, leave it be. I'd start by reproducing a case that should be easy, that is running a java app that has pre-launch tasks (And those run via mirrord too, it seems) and fail because of the scenario. I am not sure if it will fix tomcat - though, now that I think about it, maybe a better solution to detect it from the cli and just attach to existing session instead of creating new one.