Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.18+: IPC stopped sharing instaces by default? #161

Closed
KarelPeeters opened this issue Jan 2, 2022 · 6 comments · Fixed by #162
Closed

1.18+: IPC stopped sharing instaces by default? #161

KarelPeeters opened this issue Jan 2, 2022 · 6 comments · Fixed by #162

Comments

@KarelPeeters
Copy link

KarelPeeters commented Jan 2, 2022

Since version 1.18 it seems that when launching tev for the second time it does not properly connect to the existing instance any more.

For example:

image

I launched tev in the left terminal first, which opened a new window as expected. Then I launched tev in the second terminal, it says it's connecting to the primary instance (which the left terminal confirms) but then still opens its own window.

I get the same issue on the 1.18, 1.19 and 1.20 released exe files, on 1.17 everything works as normal.

Did the behavior intentionally change? I checked the change-logs but couldn't really find anything.

@Tom94
Copy link
Owner

Tom94 commented Jan 2, 2022

Hi there, yes, this behavior is intentional: opening tev without any image arguments spawns a new window now (to allow people to open multiple instances side-by-side without passing images first). I think this is more intuitive than making $ tev a no-op if a window is already open.

That said, I hadn't considered the use-case of someone wanting to either open a tev render window or reusing an existing one if it's already there. I'll modify the CLI shortly to give you the option to revert to old behavior.

@Tom94
Copy link
Owner

Tom94 commented Jan 2, 2022

(Extra background info: the IPC connection that you see in your console logs is intentional. Even when multiple windows of tev are open side-by-side, there is still only a single "primary" window that receives IPC data. When this window gets closed, one of the secondary windows automatically promotes itself to become the new primary.)

@KarelPeeters
Copy link
Author

Ah I see, that all makes sense but getting the old behavior back as an option would be very useful.

Could you elaborate on how the handover works when the primary window closes? I assume the original TCP socket still gets closed, and another instance opens a new one? Doesn't that kill exiting connections?

@Tom94
Copy link
Owner

Tom94 commented Jan 3, 2022

Yeah, the TCP socket gets closed, existing connections are killed, and the first secondary instance that manages becomes a new host that listens on the same port.

Given that the new host is a genuinely different tev instance with different images & state, I think the reset of the connection makes more sense than trying to keep the existing connection alive.

@Tom94
Copy link
Owner

Tom94 commented Jan 3, 2022

Of note: the intended function of this is that a subsequent $ tev image.exr doesn't spawn a new window if there are still existing ones -- i.e. as long as at least one instance of tev is running, one of them will handle IPC traffic.

As a corollary: the whole discussion concerns multiple tev instances that are bound to the same ip/port. If you were to spawn one regular tev instance and another via $ tev --host 127.0.0.1:1337, the second one would be its own independent primary instance.

@Tom94 Tom94 closed this as completed in #162 Jan 3, 2022
@KarelPeeters
Copy link
Author

Great, thanks a lot for explaining and the new flag!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants