nextcloud-server/tests/lib
Christoph Wurst 7dd7256cfe
Prevent duplicate auth token activity updates
The auth token activity logic works as follows
* Read auth token
* Compare last activity time stamp to current time
* Update auth token activity if it's older than x seconds

This works fine in isolation but with concurrency that means that
occasionally the same token is read simultaneously by two processes and
both of these processes will trigger an update of the same row.
Affectively the second update doesn't add much value. It might set the
time stamp to the exact same time stamp or one a few seconds later. But
the last activity is no precise science, we don't need this accuracy.

This patch changes the UPDATE query to include the expected value in a
comparison with the current data. This results in an affected row when
the data in the DB still has an old time stamp, but won't affect a row
if the time stamp is (nearly) up to date.

This is a micro optimization and will possibly not show any significant
performance improvement. Yet in setups with a DB cluster it means that
the write node has to send fewer changes to the read nodes due to the
lower number of actual changes.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 09:32:22 +07:00
..
Accounts Add new account properties 2021-10-19 04:44:40 +07:00
Activity
App Fix unit tests 2021-10-21 09:27:12 +07:00
AppFramework Add admin privilege delegation for admin settings 2021-09-29 21:43:31 +07:00
Archive
Authentication Prevent duplicate auth token activity updates 2021-10-22 09:32:22 +07:00
Avatar Fix unit tests 2021-04-27 14:34:32 +07:00
BackgroundJob Move queries to the joblist 2021-10-14 09:57:16 +07:00
Cache
Calendar Build instances of the calendar providers before using them 2021-10-14 16:06:51 +07:00
Collaboration Allow to get a local cloud id without going through the contacts manager 2021-07-14 16:08:05 +07:00
Command
Comments Add integration tests for group 2021-10-12 14:05:38 +07:00
Contacts/ContactsMenu Change origin field to appId 2021-10-20 14:47:28 +07:00
DB Add a unit test to check for casting a IQueryFunction 2021-07-07 14:19:24 +07:00
Diagnostics
DirectEditing Get the parent directory before creating a file from a template 2021-04-01 13:48:21 +07:00
Encryption
EventDispatcher
Federation Allow to get a local cloud id without going through the contacts manager 2021-07-14 16:08:05 +07:00
Files explicitly close source stream on local storage 2021-09-21 17:41:59 +07:00
GlobalScale
Group
Hooks
Http Adjust test 2021-04-06 11:37:47 +07:00
IntegrityCheck Fix integrity checker tests 2021-10-13 18:10:37 +07:00
L10N Add L10n factory method for generic language heuristics 2021-10-13 09:57:21 +07:00
Lock
Lockdown
Log
Mail Set local domain for swiftmailer transport 2021-05-31 15:04:00 +07:00
Memcache Migrate HintException to OCP 2021-06-30 15:28:02 +07:00
Migration
Notification Allow registering NotifierServices trough IBootstrap 2021-04-16 13:56:28 +07:00
OCS
Preview
PublicNamespace
Remote
Repair
RichObjectStrings
Route
Security Remove tests that just prove mocked calls and don't actually validate anything useful 2021-09-27 14:24:48 +07:00
Session
Settings Add admin privilege delegation for admin settings 2021-09-29 21:43:31 +07:00
Share
Share20 Admin Audit - Sharing: createShare - report the full path 2021-07-22 14:20:05 +07:00
Support Fix support tests 2021-04-20 17:36:15 +07:00
SystemTag
Template
Traits
Updater
User enable the user to set a primary (notification) email address (backend) 2021-09-09 19:23:04 +07:00
Util
APITest.php
AllConfigTest.php use specific email getter where necessary 2021-09-09 19:23:05 +07:00
AppConfigTest.php
AppTest.php Fix unit tests 2021-04-27 14:34:32 +07:00
AutoLoaderTest.php
CapabilitiesManagerTest.php Fix warnings about logException 2021-06-04 10:57:09 +07:00
ConfigTest.php
ContactsManagerTest.php
DateTimeFormatterTest.php
ErrorHandlerTest.php Cleaner removePassword regex 2021-03-27 18:42:58 +07:00
FileChunkingTest.php
HelperStorageTest.php
HookHelper.php
ImageTest.php
InfoXmlTest.php
InitialStateServiceTest.php Fix unit tests 2021-04-27 14:34:32 +07:00
InstallerTest.php Fix unit tests 2021-04-27 14:34:32 +07:00
LargeFileHelperGetFileSizeTest.php
LargeFileHelperTest.php
LegacyHelperTest.php Rewrite LegacyHelperTest without $this->at() 2021-06-07 21:43:30 +07:00
LoggerTest.php
MemoryInfoTest.php Let memory limit set in tests fit the used amount 2021-07-22 17:05:29 +07:00
NaturalSortTest.php
NavigationManagerTest.php Let apps toggle an unread counter on app icons 2021-06-16 17:12:56 +07:00
RepairStepTest.php
ServerTest.php
SetupTest.php Fix unit tests 2021-04-27 14:34:32 +07:00
SubAdminTest.php
TagsTest.php
TempManagerTest.php
TemplateFunctionsTest.php
TestCase.php Remove tests that just prove mocked calls and don't actually validate anything useful 2021-09-27 14:24:48 +07:00
TestMoveableMountPoint.php
UpdaterTest.php Fix unit tests 2021-04-27 14:34:32 +07:00
UrlGeneratorTest.php Merge pull request #27733 from PhrozenByte/enhancement/noid/IURLGenerator-linkToDefaultPageUrl 2021-10-05 13:06:59 +07:00
UtilCheckServerTest.php
UtilTest.php Move UtilTest::testDefaultApps() to UrlGeneratorTest 2021-07-01 16:26:55 +07:00