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

Client not always stops when requested by Windows #8979

Closed
jnweiger opened this issue Sep 7, 2021 · 17 comments · Fixed by #9142 or #9220
Closed

Client not always stops when requested by Windows #8979

jnweiger opened this issue Sep 7, 2021 · 17 comments · Fixed by #9142 or #9220
Assignees
Labels
Milestone

Comments

@jnweiger
Copy link
Contributor

jnweiger commented Sep 7, 2021

Seen (again) with 2.9.0-rc2

  • run any older version of the owncloud client
  • Download the msi installer of an update
  • click start the install.
  • It announces, it needs to shutdown owncloud and sometimes also explorer
  • when the user confirms. It usually fails to shut down one of the two.

image

After a second round it normally succeeds.

@jnweiger jnweiger mentioned this issue Sep 7, 2021
39 tasks
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 8, 2021
@TheOneRing TheOneRing removed the Stale label Oct 8, 2021
@TheOneRing TheOneRing added this to the 2.9.2 milestone Oct 8, 2021
@TheOneRing
Copy link
Member

TODO: Test how the client reacts to WM_CLOSE
@dschmidt I assume WM_CLOSE is what msi sends to the client?

@TheOneRing TheOneRing self-assigned this Oct 11, 2021
@TheOneRing TheOneRing changed the title [QA] manual update in win10 often fails to stop the application Client not always stops when requested by Windows Oct 13, 2021
@TheOneRing
Copy link
Member

The issue still occurs, in order to be able to receive the message, it appears that the window needs to shown at least once.

@TheOneRing
Copy link
Member

TheOneRing commented Nov 17, 2021

Please test with close_window.zip.
close_window owncloud.exe

With older clients the expected behaviour is that the client keeps running, independent if the settings ui was shown or not.
Once #9220 was merged the client should shutdown cleanly.

Additionally please check whether the client closes cleanly when the user logs off, with an old client and a new client.
Please test what happens when the client is updated by the installer, does the running owncloud.exe close as expected?

A clean shutdown with the new change should look similar to:

11-17 13:06:38:279 [ info sync.utility ]:	Received WM_ENDSESSION quitting
11-17 13:06:39:143 [ info gui.account.manager ]:	Saving  0  unknown certs.
11-17 13:06:39:143 [ info gui.account.manager ]:	Saving cookies. "C:/Users/hanna/AppData/Local/ownCloud/cookies0.db"
11-17 13:06:39:360 [ info sync.credentials.manager ]:	set "ownCloud_credentials:demo.owncloud.com:6c982360-b627-4cad-9196-41d7fba841a9:http/oauthtoken"
11-17 13:06:39:361 [ info gui.account.manager ]:	Saving  0  unknown certs.
11-17 13:06:39:361 [ info gui.account.manager ]:	Saving cookies. "C:/Users/hanna/AppData/Local/ownCloud/cookies0.db"
11-17 13:06:39:576 [ info gui.account.manager ]:	Saved all account settings, status: QSettings::NoError
11-17 13:06:39:578 [ info sync.database ]:	Closing DB "C:/Users/hanna/ownCloud25/.sync_journal.db"

In a clean shutdown of an old client WM_ENDSESSION would be missing.

@gabi18
Copy link
Contributor

gabi18 commented Nov 18, 2021

Tested testpilotcloud-2.9.2-rc3 on Windows 10 Version 20H2 (Build 19042.1348) VirtualBox VM:

  • as expected, close_window testpilotcloud.exe doesn't shutdown the client reliable (first attempt always fails, second attempt sometimes is successful)

  • on user logout the client shutdown isn't done cleanly, no message "Closing DB..." in log-file

@gabi18
Copy link
Contributor

gabi18 commented Nov 18, 2021

Tested testpilotcloud-2.9.2-rc4.6086.x64 on Windows 10 Version 20H2 (Build 19042.1348) VirtualBox VM:

  • on close_window testpilotcloud.exe, a clean, reliable shutdown of the testpilotcloud (both tesetd: client settings UI shown/not shown) is done, the DB is closed correctly
11-18 12:12:10:700 [ info sync.utility ]:	Received WM_ENDSESSION quitting
11-18 12:12:10:746 [ debug gui.account.manager ]	[ OCC::AccountManager::saveAccount ]:	Saving account "https://gm-owncloud-1080-test-server.owncloud.works/"
11-18 12:12:10:761 [ info gui.account.manager ]:	Saving  0  unknown certs.
11-18 12:12:10:761 [ info gui.account.manager ]:	Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 12:12:10:761 [ debug sync.cookiejar ]	[ OCC::CookieJar::save ]:	"C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 12:12:10:784 [ debug gui.account.manager ]	[ OCC::AccountManager::saveAccount ]:	Saved account settings, status: QSettings::NoError
11-18 12:12:10:784 [ info sync.credentials.manager ]:	set "testpilotcloud_credentials:gm-owncloud-1080-test-server.owncloud.works:b9a0fd8b-c797-460b-86b5-03f6133aa287:http/password"
11-18 12:12:10:784 [ info gui.account.manager ]:	Saving  0  unknown certs.
11-18 12:12:10:784 [ info gui.account.manager ]:	Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 12:12:10:784 [ debug sync.cookiejar ]	[ OCC::CookieJar::save ]:	"C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 12:12:10:784 [ info gui.account.manager ]:	Saved all account settings, status: QSettings::NoError
11-18 12:12:10:784 [ debug gui.folderwatcher ]	[ OCC::WatcherThread::watchChanges ]:	Received stop event, aborting folder watcher thread
11-18 12:12:10:784 [ info sync.database ]:	Closing DB "C:/Users/gabi/testpilotcloud/.sync_journal.db"
11-18 12:12:10:817 [ debug gui.socketapi ]	[ OCC::SocketApi::~SocketApi ]:	dtor
  • on user logout the behaviour is like before, same for restart and system shutdown

The logfile ends without "Closing DB..."

11-18 12:29:03:235 [ debug sync.database ]	[ OCC::SyncJournalDb::commitInternal ]:	Transaction commit "setSelectiveSyncList" and starting new transaction
11-18 12:29:03:238 [ info gui.application ]:	Sync state changed for folder  "https://gm-owncloud-1080-test-server.owncloud.works/remote.php/dav/files/demo/" :  "Success"

20211118_1229_owncloud.log.0_NOT_Closing_DB.gz

When starting testpilot on commandline with --logflush the last logline is:

11-18 13:06:09:545 [ debug sync.networkjob ]	[ OCC::AbstractNetworkJob::slotFinished ]:	Network job finished OCC::PropfindJob("https://gm-owncloud-1080-test-server.owncloud.works/remote.php/dav/files/demo/", "7359f6d9-89ba-416f-8e56-1bd3888cee47", "7359f6d9-89ba-416f-8e56-1bd3888cee47")
11-18 13:06:15:108 [ info sync.utility ]:	Received WM_ENDSESSION quitting

testpilot-logout.zip

Explorer shows that db was not closed correctly
DB_not_closed

@gabi18
Copy link
Contributor

gabi18 commented Nov 22, 2021

Tested update from testpilotcloud-2.9.2-rc4.6086.x64 to testpilotcloud-2.9.2-rc4.6087.x64 on Windows 10 Version 20H2 (Build 19042.1348) VirtualBox VM

The testpilot-client is shutdown correctly when requested from msi installer:

12:51:41:907 [ info sync.utility ]:       Received WM_ENDSESSION quitting
11-22 12:51:41:955 [ debug gui.account.manager ]        [ OCC::AccountManager::saveAccount ]:   Saving account "https://gm-owncloud-1080-test-server.owncloud.works/"
11-22 12:51:41:970 [ info gui.account.manager ]:        Saving  0  unknown certs.
11-22 12:51:41:970 [ info gui.account.manager ]:        Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-22 12:51:41:970 [ debug sync.cookiejar ]     [ OCC::CookieJar::save ]:       "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-22 12:51:41:970 [ debug gui.account.manager ]        [ OCC::AccountManager::saveAccount ]:   Saved account settings, status: QSettings::NoError
11-22 12:51:41:970 [ info sync.credentials.manager ]:   set "testpilotcloud_credentials:gm-owncloud-1080-test-server.owncloud.works:b9a0fd8b-c797-460b-86b5-03f6133aa287:http/password"
11-22 12:51:41:970 [ info gui.account.manager ]:        Saving  0  unknown certs.
11-22 12:51:41:970 [ info gui.account.manager ]:        Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-22 12:51:41:970 [ debug sync.cookiejar ]     [ OCC::CookieJar::save ]:       "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-22 12:51:42:002 [ info gui.account.manager ]:        Saved all account settings, status: QSettings::NoError
11-22 12:51:42:002 [ debug gui.folderwatcher ]  [ OCC::WatcherThread::watchChanges ]:   Received stop event, aborting folder watcher thread
11-22 12:51:42:002 [ info sync.database ]:      Closing DB "C:/Users/gabi/testpilotcloud/.sync_journal.db"
11-22 12:51:42:017 [ debug gui.socketapi ]      [ OCC::SocketApi::~SocketApi ]: dtor
11-22 12:51:42:017 [ info gui.socketapi ]:      Lost connection  QLocalSocket(0x11fdc4b0d30)

@gabi18
Copy link
Contributor

gabi18 commented Nov 23, 2021

Confirmed that testpilot is shutdown correctly when updating testpilotcloud-2.9.2-rc4 -> testpilotcloud-2.9.2-rc5.6114.x64.msi

11-18 09:45:01:343 [ info sync.utility ]:       Received WM_ENDSESSION quitting
11-18 09:45:01:390 [ debug gui.account.manager ]        [ OCC::AccountManager::saveAccount ]:   Saving account "https://gm-owncloud-1080-test-server.owncloud.works/"
11-18 09:45:01:421 [ info gui.account.manager ]:        Saving  0  unknown certs.
11-18 09:45:01:421 [ info gui.account.manager ]:        Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 09:45:01:427 [ debug sync.cookiejar ]     [ OCC::CookieJar::save ]:       "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 09:45:01:460 [ debug gui.account.manager ]        [ OCC::AccountManager::saveAccount ]:   Saved account settings, status: QSettings::NoError
11-18 09:45:01:460 [ info sync.credentials.manager ]:   set "testpilotcloud_credentials:gm-owncloud-1080-test-server.owncloud.works:b9a0fd8b-c797-460b-86b5-03f6133aa287:http/password"
11-18 09:45:01:460 [ info gui.account.manager ]:        Saving  0  unknown certs.
11-18 09:45:01:460 [ info gui.account.manager ]:        Saving cookies. "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 09:45:01:460 [ debug sync.cookiejar ]     [ OCC::CookieJar::save ]:       "C:/Users/gabi/AppData/Local/testpilotcloud/cookies0.db"
11-18 09:45:01:492 [ info gui.account.manager ]:        Saved all account settings, status: QSettings::NoError
11-18 09:45:01:506 [ debug gui.folderwatcher ]  [ OCC::WatcherThread::watchChanges ]:   Received stop event, aborting folder watcher thread
11-18 09:45:01:506 [ info sync.database ]:      Closing DB "C:/Users/gabi/testpilotcloud/.sync_journal.db"
11-18 09:45:01:527 [ debug gui.socketapi ]      [ OCC::SocketApi::~SocketApi ]: dtor

@gabi18
Copy link
Contributor

gabi18 commented Nov 23, 2021

Scenario "User logout" tested with testpilotcloud-2.9.2-rc5.6114.x64.msi:

  • after user logout and login in again there isn't a message "Received WM_ENDSESSION quitting" nor a logline "Closing DB ..." in the logs.
  • mostly the db is closed
  • but it also occured that it remains open:

NO_Closing-2 9 2-rc5

testpilot2.zip

@TheOneRing
Copy link
Member

In that scenario using --logfile won't work as expected as the console process might get killed before us.
Please use the internal log file.

@gabi18
Copy link
Contributor

gabi18 commented Nov 23, 2021

The internal logfile when the db is closed after user logout/login also doesn't contain the line "Closing DB ..."

20211122_1047_owncloud.log.zip

but the db is closed:
db_written-2 9 2-rc5

@gabi18
Copy link
Contributor

gabi18 commented Nov 23, 2021

Summary for testscenario "User logout" testpilotcloud-2.9.2-rc5.6114.x64.msi on Windows 10 Version 20H2 (Build 19042.1348) VirtualBox VM:

@gabi18
Copy link
Contributor

gabi18 commented Nov 23, 2021

Finally got a logfile with "Closing DB..." (--logflush was missing)

11-23 14:50:47:743 [ debug gui.folderwatcher ]  [ OCC::WatcherThread::watchChanges ]:   Received stop event, aborting folder watcher thread
11-23 14:50:47:743 [ info sync.database ]:      Closing DB "C:/Users/gabi/testpilotcloud/.sync_journal.db"
11-23 14:50:47:758 [ debug gui.socketapi ]      [ OCC::SocketApi::~SocketApi ]: dtor
11-23 14:50:47:758 [ info gui.socketapi ]:      Lost connection  QLocalSocket(0x1cdca7022f0)
11-23 14:50:47:773 [ debug sync.utility ]       [ `anonymous-namespace'::startShutdownWatcher::::operator() ]:  app closed
11-23 14:50:47:773 [ info sync.utility ]:       WM_ENDSESSION successfully shut down 28472197

20211123_1448_owncloud.log.zip

@TheOneRing
Copy link
Member

@gabi18 Can we close this one?

@gabi18
Copy link
Contributor

gabi18 commented Nov 25, 2021

Yes, I think so.
I have just retested update 2.9.2 rc5 to v2.9.2, the msi installer shutdown works reliable.
Also on system shutdown the db is closed successfully.

11-25 13:46:45:370 [ info sync.database ]:      Closing DB "C:/Users/gabi/testpilotcloud/.sync_journal.db"
11-25 13:46:45:430 [ debug gui.socketapi ]      [ OCC::SocketApi::~SocketApi ]: dtor
11-25 13:46:45:430 [ info gui.socketapi ]:      Lost connection  QLocalSocket(0x21f53cf49a0)
11-25 13:46:45:430 [ debug sync.utility ]       [ `anonymous-namespace'::startShutdownWatcher::::operator() ]:  app closed
11-25 13:46:45:430 [ info sync.utility ]:       WM_ENDSESSION successfully shut down 3292762

@gabi18 gabi18 closed this as completed Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants