Skip to content

Second app instance does not exit #1066

Open
@Junology

Description

@Junology
Contributor

Most appropriate sub-area of Processing 4?

PDE

Processing version

4.4.3 (portable)

Operating system

Linux (Ubuntu 20.04 x64)

Steps to reproduce this

"1. Download processing-4.4.3-linux-x64-portable.zip, extract it, and cd Processing/bin

  1. ./Processing & and wait for Processing to launch.

  2. ./Processing & again and wait for the second Processing IDE to launch.

  3. Close both Processing windows.

  4. ps | grep Processing and you'll see the second Processing process is still alive."

snippet

Additional context

I also observed the same happens for local build with Gradle.
The problem is not critical since Ctrl-C terminates it anyway, but it is a bit bothering when it happens.

Would you like to work on the issue?

No; I am not familier with Kotlin, sorry.

Activity

Stefterv

Stefterv commented on Apr 29, 2025

@Stefterv
Collaborator

Good point, I've also seen this happen on macOS. As for a bit of background:

static boolean alreadyRunning(String[] args) {
return Preferences.get(SERVER_PORT) != null && sendArguments(args);
}
I suspect something in the send arguments code might not be finishing, keeping the second instance of Processing alive.

Junology

Junology commented on Apr 30, 2025

@Junology
ContributorAuthor

Glancing at the source, I noticed that existing instance check, i.e., SingleInstance.alreadyRunning is performed in processing.app.Base. IMO, the method should be called from the genuine startup code processing.app.ui.Start.main, right? Otherwise, we have to see the splash screen in each time we open a sketch from file managers, as it is now.

AhmedMagedC

AhmedMagedC commented on May 3, 2025

@AhmedMagedC

I can also reproduce this bug on windows
I have also observed that when you open multiple instances like three processes and you try to close any of them, they all remain exist, until you close every one of them then only one of the processes exits and the rest remains

i would love to work on this issue

linked a pull request that will close this issue on May 4, 2025
added this to the 4.4.5 milestone on May 12, 2025
moved this to In progress in Processing Roadmapon Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededpdeProcessing Development Environment

Type

No type

Projects

Status

In progress

Relationships

None yet

    Development

    Participants

    @Junology@Stefterv@AhmedMagedC

    Issue actions

      Second app instance does not exit · Issue #1066 · processing/processing4