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

Allow single app instance per configuration #12083

Merged
merged 1 commit into from Mar 9, 2020

Conversation

glassez
Copy link
Member

@glassez glassez commented Feb 27, 2020

Closes #8653.
Closes #11082.

@glassez glassez added the Core label Feb 27, 2020
@glassez glassez added this to the 4.2.2 milestone Feb 27, 2020
@glassez glassez force-pushed the app-instances branch 2 times, most recently from 2ad7b4e to 3bb2d2a Compare February 27, 2020 08:01
thalieht
thalieht previously approved these changes Feb 27, 2020
Copy link
Contributor

@thalieht thalieht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested.
p.s. Also closes #11082

@FranciscoPombal
Copy link
Member

@glassez
Looks good, but isn't this a good time to update the man pages as well? They are missing a ton of options and a description of how to use them and what they do. This new behavior and how to use profileDir and configurationName should also be documented there.

src/app/application.cpp Outdated Show resolved Hide resolved
src/app/application.cpp Show resolved Hide resolved
Chocobo1
Chocobo1 previously approved these changes Feb 28, 2020
@glassez
Copy link
Member Author

glassez commented Mar 6, 2020

Waiting one more day for @sledgehammer999 review...

Copy link
Member

@FranciscoPombal FranciscoPombal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glassez So you're not going to address the manpages in this PR (see my previous comment)?

@glassez
Copy link
Member Author

glassez commented Mar 7, 2020

@glassez So you're not going to address the manpages in this PR (see my previous comment)?

Sorry, no.

@FranciscoPombal
Copy link
Member

Sorry, no.

Ok.

@glassez glassez merged commit a7b342e into qbittorrent:master Mar 9, 2020
@glassez glassez deleted the app-instances branch March 9, 2020 04:41
@arvobowen
Copy link

So is this currently a beta release? Also, how do you use this new feature? I'm guessing this allows you to run two different instances of qbittorrent correct?

@glassez
Copy link
Member Author

glassez commented Mar 11, 2020

So is this currently a beta release?

We don't produce betas for minor releases.

I'm guessing this allows you to run two different instances of qbittorrent correct?

Two or more. It produces independent instance for each configuration path/name (you can set it via command line).

@mzso
Copy link

mzso commented Mar 25, 2020

So this commit suggests I'm allowed to have one instance only unless I specify another.
This is not what happens.
I created a profile in QB's directory to make it portable and moved my stuff there. However a multiple instance is started whenever I open a torrent file.

@glassez
Copy link
Member Author

glassez commented Mar 26, 2020

So this commit suggests I'm allowed to have one instance only unless I specify another.

It creates (should create) different instances per configuration (i.e. profile path + configuration name).

I created a profile in QB's directory to make it portable and moved my stuff there. However a multiple instance is started whenever I open a torrent file.

Please provide more details.
How do you launch first instance? How do you exactly open torrent file? Do you run qBittorrent binary located within the same path?

@mzso
Copy link

mzso commented Mar 26, 2020

So this commit suggests I'm allowed to have one instance only unless I specify another.

It creates (should create) different instances per configuration (i.e. profile path + configuration name).

I created a profile in QB's directory to make it portable and moved my stuff there. However a multiple instance is started whenever I open a torrent file.

Please provide more details.
How do you launch first instance? How do you exactly open torrent file? Do you run qBittorrent binary located within the same path?

Either via a plain icon in the quick launch area, via autorun I have set up.
Opening a torrent is via double click, or enter within Total Commander.

(If I drag and drop a torrent unsurprisingly no new instance is started)

@glassez
Copy link
Member Author

glassez commented Mar 26, 2020

Please provide a log message about used Profile path from both instances.

@mzso
Copy link

mzso commented Mar 27, 2020

Seems pretty identical. Apart from the drive letter. (but paths aren't supposed to be case sensitive)

2020.03.27. 10:50 - qBittorrent v4.2.2 elindult
2020.03.27. 10:50 - Futtatás hordozható módban. Automatikusan észlelt profilmappa: D:/Programok/qBittorrent/profile

2020.03.27. 10:51 - qBittorrent v4.2.2 elindult
2020.03.27. 10:51 - Futtatás hordozható módban. Automatikusan észlelt profilmappa: d:/Programok/qBittorrent/profile

@mzso
Copy link

mzso commented Mar 28, 2020

@glassez commented on 2020. márc. 26. 20:08 CET:

Please provide a log message about used Profile path from both instances.

The CLI doesn't seem much different either, as per Process Explorer:

"D:\Programok\qBittorrent\qbittorrent.exe"

"d:\Programok\qBittorrent\qbittorrent.exe" "d:\Letöltés\test.torrent"

Not sure why there's a space after the double quote character in the first case.

@glassez
Copy link
Member Author

glassez commented Mar 28, 2020

but paths aren't supposed to be case sensitive

They're case insensitive from the Windows filesystem perspective. But they're still different strings so they produce different instance IDs.
Seems we need to ignore case in profile path on Windows when create instance ID.

@mzso
Copy link

mzso commented Mar 29, 2020

An update: It seems like the secondary instance is broken. It doesn't connect to anything. Added torrents never start, the trackers just show "not yet connected" or something in that vein. And the old torrents don't produce any traffic either, not even after hours. (I accidentally closed the first instance one instead of the duplicate)

@glassez
Copy link
Member Author

glassez commented Mar 30, 2020

It seems like the secondary instance is broken. It doesn't connect to anything.

Sure. It uses the same config as the first one so there are conflicts.

@mzso
Copy link

mzso commented Apr 2, 2020

Okay. So it seems to work normally now in 4.2.3.

@null-character
Copy link

IDK if this is related but in recent versions on qB I get multiple instances unintentionally. Say I have qB open and use the browser to add a few new torrents either via magnet or .torrent.

Sometimes it will open a second instance that never works. So I need to close and re-add it to the correct instance.

Is there a UI way to override this to NEVER allow a second instance?

@glassez
Copy link
Member Author

glassez commented May 21, 2020

Can you check what configuration path is printed in Log in both instances (when it happens next time)?

@null-character
Copy link

Sure no problem. It happens pretty infrequently though.

@mzso
Copy link

mzso commented May 21, 2020

Sure no problem. It happens pretty infrequently though.

Last time it was case sensitivity. I guess it will be something similarly trivial...

@null-character
Copy link

So it just happened and I checked and they both have the exact same path. Which is 6/5/2020 6:53 PM - Using config directory: C:/Users/autostart/AppData/Roaming/qBittorrent/

The second instance showed a bunch of errors about the port/socket/whatever already being in use.

I closed both instances and re-opened and the file was there and then started to download.

I'm on the latest version of qB and the browser I used to click the link is the new Chromium Edge.

@Zorlin
Copy link

Zorlin commented Mar 1, 2021

Does this apply to -nox? I'm trying to run 10 instances of it and using separate config for each. Cheers~!

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

Successfully merging this pull request may close these issues.

Allow some way to specify instance name Running multiple instances of qBittorrent
8 participants