nextcloud-desktop/src/libsync
Olivier Goffart 868d4c781a HTTP creds: Fix GUI blocking for 5 seconds when entering wrong password
The Qt HTTP thread calls authenticationRequired (indirectly) using a
BlockingQueuedConnection. So when we call invalidateToken from slot
connected to this signal and end up calling QNAM::clearAccessCache which
waits on the thread for 5 seconds

Backtraces:

Qt HTTP thread:
 #0  0x00007ffff20c707f in pthread_cond_wait@@GLIBC_2.3.2 ()
 #1  0x00007ffff43f0c0b in QWaitConditionPrivate::wait
 #2  QWaitCondition::wait
 #3  0x00007ffff43ea06b in QSemaphore::acquire
 #4  0x00007ffff45dcf6f in QMetaObject::activate
[...]
 #9  0x00007ffff45dd607 in QMetaObject::activate
 #10 0x00007ffff4edbaf7 in QHttpNetworkReply::authenticationRequired
 #11 0x00007ffff4e0b2b4 in QHttpNetworkConnectionPrivate::handleAuthenticateChallenge
 #12 0x00007ffff4e10753 in QHttpNetworkConnectionChannel::handleStatus
 #13 0x00007ffff4e11cc9 in QHttpNetworkConnectionChannel::allDone
 #14 0x00007ffff4e14605 in QHttpProtocolHandler::_q_receiveReply

Main Thread:
 #0  0x00007ffff20c7428 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
 #1  0x00007ffff43f0b56 in QWaitConditionPrivate::wait_relative (time=5000, this=0x136c580)
 #2  QWaitConditionPrivate::wait (time=5000, this=0x136c580)
 #3  QWaitCondition::wait (this=this@entry=0x136c788, mutex=mutex@entry=0x136c760, time=time@entry=5000)
 #4  0x00007ffff43efa6e in QThread::wait (this=<optimized out>, time=time@entry=5000)
 #5  0x00007ffff4e1edd3 in QNetworkAccessManagerPrivate::clearCache
 #6  0x00007ffff7b6fb03 in OCC::HttpCredentials::invalidateToken()
 #7  0x000000000057adb4 in OCC::AccountState::slotInvalidCredentials()
 #8  0x000000000057ac76 in OCC::AccountState::slotConnectionValidatorResult(OCC::ConnectionValidator::Status, QStringList const&) ()
 #9  0x00000000005ab45c in OCC::AccountState::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
 #10 0x00007ffff45dcd30 in QMetaObject::activate
 #11 0x00007ffff7b78671 in OCC::ConnectionValidator::connectionResult(OCC::ConnectionValidator::Status, QStringList) ()
 #12 0x00007ffff7ae2514 in OCC::ConnectionValidator::reportResult(OCC::ConnectionValidator::Status) ()
 #13 0x00007ffff7ae39b7 in OCC::ConnectionValidator::slotAuthFailed(QNetworkReply*) ()
 #14 0x00007ffff7b784a9 in OCC::ConnectionValidator::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #15 0x00007ffff45dcd30 in QMetaObject::activate
 #16 0x00007ffff7b766dc in OCC::AbstractNetworkJob::networkError(QNetworkReply*)
 #17 0x00007ffff7af9f6e in OCC::AbstractNetworkJob::slotFinished()
 #18 0x00007ffff7b7654d in OCC::AbstractNetworkJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #20 0x00007ffff45dd607 in QMetaObject::activate
 #21 0x00007ffff4edd143 in QNetworkReply::finished
 #22 0x00007ffff4e3fec7 in QNetworkReplyHttpImplPrivate::finished
 #23 0x00007ffff4e41818 in QNetworkReplyHttpImpl::close
 #24 0x00007ffff7b7047b in OCC::HttpCredentials::slotAuthentication(QNetworkReply*, QAuthenticator*) ()
 #25 0x00007ffff7b79092 in OCC::HttpCredentials::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #27 0x00007ffff45dd607 in QMetaObject::activate
 #28 0x00007ffff4e1d6fb in QNetworkAccessManager::authenticationRequired
 #29 0x00007ffff4e1ea07 in QNetworkAccessManagerPrivate::authenticationRequired
 #30 0x00007ffff4e3c784 in QNetworkReplyHttpImplPrivate::httpAuthenticationRequired

Another case of Main Thread:
 #5  0x00007ffff4e1edd3 in QNetworkAccessManagerPrivate::clearCache
 #6  0x00007ffff7b6fb03 in OCC::HttpCredentials::invalidateToken()
 #7  0x000000000057b1e4 in OCC::AccountState::slotInvalidCredentials() ()
 #8  0x00000000005abb8a in OCC::AccountState::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #9  0x00007ffff45dcd30 in QMetaObject::activate
 #10 0x00007ffff7b76ed5 in OCC::Account::invalidCredentials() ()
 #11 0x00007ffff7ad55f5 in OCC::Account::handleInvalidCredentials()
 #12 0x00007ffff7afa69a in OCC::AbstractNetworkJob::slotFinished()
 #13 0x00007ffff7b7654d in OCC::AbstractNetworkJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #15 0x00007ffff45dd607 in QMetaObject::activate
 #16 0x00007ffff4edd143 in QNetworkReply::finished
 #17 0x00007ffff4e3fec7 in QNetworkReplyHttpImplPrivate::finished
 #18 0x00007ffff4e41818 in QNetworkReplyHttpImpl::close
 #19 0x00007ffff7b7047b in OCC::HttpCredentials::slotAuthentication(QNetworkReply*, QAuthenticator*) ()
 #20 0x00007ffff7b79092 in OCC::HttpCredentials::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
 #22 0x00007ffff45dd607 in QMetaObject::activate
 #23 0x00007ffff4e1d6fb in QNetworkAccessManager::authenticationRequired
2016-01-07 14:46:49 +01:00
..
creds HTTP creds: Fix GUI blocking for 5 seconds when entering wrong password 2016-01-07 14:46:49 +01:00
abstractnetworkjob.cpp Debug: Attempt to make log more useful 2016-01-05 15:12:00 +01:00
abstractnetworkjob.h Connectivity: Improve reconnecting after network change/disconnect #4167 2015-11-23 21:48:26 +01:00
accessmanager.cpp QNAM: Use invalid configuration instead of default configuration 2015-11-17 11:02:53 +01:00
accessmanager.h System proxy: Ask for credentials if needed. 2015-07-17 11:54:46 +02:00
account.cpp Log: Remove scary messages :) 2015-12-10 11:50:19 +01:00
account.h Added Non Shibboleth WebDAV authentication and Dav Path customization to owncloudcmd 2015-11-02 22:57:17 +01:00
accountfwd.h Folders: Show as disconnected when account is disconnected. 2015-07-03 15:03:18 +02:00
bandwidthmanager.cpp libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
bandwidthmanager.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
capabilities.cpp Share UI: Hide 'allow editing' for files #4211 2015-12-08 15:37:17 +01:00
capabilities.h Checksum: Fixes after review 2015-10-28 14:46:20 +01:00
checksums.cpp Doc: Add checksum overview 2015-12-08 10:59:42 +01:00
checksums.h Checksums: Reuse the discovery checksum where possible 2015-11-23 14:13:10 +01:00
clientproxy.cpp Remove legacy propagator and neon 2015-10-20 17:57:43 +02:00
clientproxy.h Remove legacy propagator and neon 2015-10-20 17:57:43 +02:00
CMakeLists.txt Rename files 2015-11-23 12:09:25 +01:00
configfile.cpp Revert "Config: Use monochrome icons per default on MacOSX." 2015-10-29 15:37:31 +01:00
configfile.h libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
connectionvalidator.cpp Connectivity: Improve reconnecting after network change/disconnect #4167 2015-11-23 21:48:26 +01:00
connectionvalidator.h Connectivity: Improve reconnecting after network change/disconnect #4167 2015-11-23 21:48:26 +01:00
cookiejar.cpp Fix compilation with Qt 5.5 2015-04-19 11:02:43 +02:00
cookiejar.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
discoveryphase.cpp SyncEngine: Handle 403 Forbidden properly. 2015-11-18 15:31:55 +01:00
discoveryphase.h Discovery: conding style: use const references for function parameters 2015-10-29 16:47:36 +01:00
excludedfiles.cpp FolderWatcher: Use csync exclude code #3805 2015-10-02 15:56:39 +02:00
excludedfiles.h FolderWatcher: Use csync exclude code #3805 2015-10-02 15:56:39 +02:00
filesystem.cpp Windows: Fix deleting and replacing of read-only files #4308 2016-01-05 13:15:59 +01:00
filesystem.h Windows: Fix deleting and replacing of read-only files #4308 2016-01-05 13:15:59 +01:00
libsync.md Structure developer documentation 2015-06-29 18:43:21 +02:00
logger.cpp Logger: speedup the sync discovery when the log is innactive 2015-10-22 00:22:25 +02:00
logger.h Logger: don't call qFormatLog when unessesary 2015-10-20 13:22:48 +02:00
networkjobs.cpp Add an experimental ProppatchJob #3235 2015-11-23 11:59:56 +01:00
networkjobs.h Add an experimental ProppatchJob #3235 2015-11-23 11:59:56 +01:00
owncloudpropagator.cpp Don't show parent folders in the error list #3796 2016-01-06 12:37:35 +01:00
owncloudpropagator.h Propagator: Deal with directories becoming files #4302 2016-01-05 10:26:41 +01:00
owncloudpropagator_p.h ETag: Allow parsing of weak tags #3946 2015-10-15 14:57:34 +02:00
owncloudtheme.cpp Use HTTPS links 2015-08-10 12:30:33 +02:00
owncloudtheme.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
ownsql.cpp OwnSQL: add asserts in case of error that should not happen 2015-10-30 14:05:58 +01:00
ownsql.h Checksum: Put checksum type into separate column #3735 2015-10-28 14:46:20 +01:00
progressdispatcher.cpp legacy propagator: Remove more code 2015-10-28 10:59:02 +01:00
progressdispatcher.h legacy propagator: Remove more code 2015-10-28 10:59:02 +01:00
propagatedownload.cpp Windows: Fix deleting and replacing of read-only files #4308 2016-01-05 13:15:59 +01:00
propagatedownload.h Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
propagateremotedelete.cpp libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
propagateremotedelete.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
propagateremotemkdir.cpp libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
propagateremotemkdir.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
propagateremotemove.cpp Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
propagateremotemove.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
propagateupload.cpp Blacklist: Clear on successful chunk upload #3934 2015-11-24 10:09:55 +01:00
propagateupload.h Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
propagatorjobs.cpp Windows: Fix deleting and replacing of read-only files #4308 2016-01-05 13:15:59 +01:00
propagatorjobs.h Propagator: Deal with directories becoming files #4302 2016-01-05 10:26:41 +01:00
syncengine.cpp Translation cleanups 2016-01-06 16:50:59 +01:00
syncengine.h Rename files 2015-11-23 12:09:25 +01:00
syncfileitem.h SocketAPI: Don't use ERROR for SoftErrors #3944 2015-12-10 11:02:38 +01:00
syncfilestatus.cpp Rename SyncFileStatus::STATUS_SYNC to STATUS_UPTODATE 2016-01-05 15:41:15 +01:00
syncfilestatus.h Rename SyncFileStatus::STATUS_SYNC to STATUS_UPTODATE 2016-01-05 15:41:15 +01:00
syncjournaldb.cpp Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
syncjournaldb.h Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
syncjournalfilerecord.cpp SyncJournalFileRecord: Fix comparison operator 2015-11-25 21:11:58 +01:00
syncjournalfilerecord.h Checksums: Don't reupload if size and checksum are unchanged #3235 2015-11-23 11:59:56 +01:00
syncresult.cpp Adjust namespaces 2014-11-09 22:34:07 +01:00
syncresult.h Use doxygen style everywhere 2015-06-29 18:56:09 +02:00
theme.cpp Added Non Shibboleth WebDAV authentication and Dav Path customization to owncloudcmd 2015-11-02 22:57:17 +01:00
theme.h Added Non Shibboleth WebDAV authentication and Dav Path customization to owncloudcmd 2015-11-02 22:57:17 +01:00
utility.cpp Utilities: Include math.h because of floor() 2015-12-02 17:56:37 +01:00
utility.h AcitivityWidget: Moved timespan-in-words method to utility. 2015-11-16 18:08:25 +01:00
utility_mac.cpp OS X: Fix a few warnings 2015-06-17 14:32:34 +02:00
utility_unix.cpp Consistency: Use folder instead of directory in user visible strings 2015-09-07 08:51:40 +02:00
utility_win.cpp Revert "Use dynamic library loading for detecting the correct path for links" 2015-08-06 10:41:33 +02:00
version.h.in Reduce the amount of rebuild needed after a git commit 2015-06-17 14:32:34 +02:00