Skip to content

Commit

Permalink
Update VM properties map after loading the agent server so that recon…
Browse files Browse the repository at this point in the history
…necting on the desired port works

Without updating the properties map, our side doesn't know the server is running and tries to kick off a new one on a new port, which fails since the server is actually already running.
  • Loading branch information
Col-E committed Sep 25, 2023
1 parent d92361c commit bc73b3b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ public WorkspaceRemoteVmResource createRemoteResource(VirtualMachineDescriptor i
else
agentArgs += ",namelessThreads";
virtualMachine.loadAgent(agentAbsolutePath, agentArgs);

// The agent server will update some properties to indicate its active.
// We need to update our map so that we can see this indicator so that we can extract
// the port that the server is running on if we want to reconnect.
Properties systemProperties = virtualMachine.getSystemProperties();
virtualMachinePropertiesMap.put(item, systemProperties);
} catch (AgentLoadException ex) {
// The agent jar file is written in Java 8. But Recaf uses Java 11+.
// This is a problem on OUR side because Java 11+ handles agent interactions differently.
Expand Down

0 comments on commit bc73b3b

Please sign in to comment.