Commit Graph

1290 Commits

Author SHA1 Message Date
Fabio Erculiani
301aa281d5 [entropy.client] avoid races in Entropy Client @property methods 2014-01-05 13:59:14 +01:00
Fabio Erculiani
881f8831cf [entropy.client] set _real_enabled_repos atomically
The race was triggered by the startup code path in Rigo.
2014-01-05 13:55:31 +01:00
Fabio Erculiani
8c4737ef7a [entropy.core] SystemSettingsPlugin: make parse() return plugin metadata
This is needed in order to avoid infinite recursion through
__maybe_lazy_load()
2014-01-05 13:32:36 +01:00
Fabio Erculiani
64fb91dcae [entropy.core] SystemSettings: enable lazy loading of external plugins as well 2014-01-05 13:00:31 +01:00
Fabio Erculiani
92a5f2fcc1 Release Entropy 264 2014-01-04 11:16:46 +01:00
Fabio Erculiani
3ebba8b14f [entropy.db.sql] fix typo in SQL query, s/tag/versiontag/ 2014-01-04 11:15:27 +01:00
Fabio Erculiani
c48869bb31 [entropy.core] SystemSettings: drop mtime based in-RAM cache
It does more harm than good and we have lazy loading now
2014-01-04 11:01:27 +01:00
Fabio Erculiani
c98c39db06 [entropy.core] SystemSettings: drop mtime based cache validation
This is no longer necessary and error prone on filesystems with
coarse mtime granularity (like ext3). Individual methods are able
to validate their own caches.
2014-01-04 10:31:09 +01:00
Fabio Erculiani
5da276bfb6 [entropy.core] SystemSettings: __remove_repo_cache() is no longer necessary 2014-01-04 10:10:49 +01:00
Fabio Erculiani
9af5689a13 [entropy.core] SystemSettings: simplify __getitem__ 2014-01-03 20:57:10 +01:00
Fabio Erculiani
ab6d1f9fc4 [entropy.core] SystemSettings: lazy load item only if it hasn't been loaded yet 2014-01-03 20:55:36 +01:00
Fabio Erculiani
2053989b27 [entropy.core] SystemSettings: add lazy loading of metadata 2014-01-03 20:25:52 +01:00
Fabio Erculiani
7877126107 Release Entropy 263 2014-01-03 16:12:21 +01:00
Fabio Erculiani
b0bd765b50 [entropy.db.sqlite] do not acquire the repo lock if it's not strictly needed
Try to avoid to acquire the repository lock in exclusive mode if
it's not strictly needed. We were acquiring the lock in exclusive mode
even when there was nothing to update due to schema changes.
2014-01-03 16:10:33 +01:00
Fabio Erculiani
f1de6accef Release Entropy 262 2014-01-03 15:50:06 +01:00
Fabio Erculiani
74f8bb63f5 [entropy.spm] PortagePlugin: update portage.doebuild() call, remove deprecated root argument 2014-01-03 15:45:39 +01:00
Fabio Erculiani
d03466ea10 [entropy.db.cache] disable in-RAM cache if total memory is less than 4G 2014-01-03 14:54:04 +01:00
Fabio Erculiani
ee48b812ed [entropy.tools] add total_memory() function 2014-01-03 14:53:42 +01:00
Fabio Erculiani
338b3f6cc5 [entropy.db] expose and use the currently set cache policy 2014-01-02 23:00:00 +01:00
Fabio Erculiani
b6ed5f9948 [entropy.db.cache] introduce EntropyRepositoryCachePolicies
It is now possible to define a policy for the in-RAM cache through
EntropyRepository constructor or EntropyRepositoryCachePolicies.
2014-01-02 22:58:54 +01:00
Fabio Erculiani
2d22414086 Release Entropy 261 2014-01-01 11:03:52 +01:00
Fabio Erculiani
e16ad0a828 [entropy.db.sqlite] catch LockAcquireError in _maybeDatabaseSchemaUpdates
User may not have the privileges to acquire the lock, but we should
not fail here.
2014-01-01 10:58:54 +01:00
Fabio Erculiani
999f0509dd [entropy.db] raise LockAcquireError in case of lock acquire error failures 2014-01-01 10:58:17 +01:00
Fabio Erculiani
f0d437a090 Release Entropy 260 2013-12-31 18:01:25 +01:00
Fabio Erculiani
2f713f73d5 [entropy.db.sqlite] raise timeout to 300 seconds
This will better fit slow disks.
2013-12-31 18:00:35 +01:00
Fabio Erculiani
1598f5e501 [entropy.*] use get_repository() to return a GenericRepository as well
All the repository classes must go through get_repository() to allow
further monkey patching and other external, API consumer related features.
2013-12-31 17:50:31 +01:00
Fabio Erculiani
4edaf614f4 [entropy.db.sql] in global context, the current thread is always MainThread 2013-12-31 17:38:57 +01:00
Fabio Erculiani
72aa0a07d1 [entropy.*] turn get_repository() into a classmethod 2013-12-31 17:30:29 +01:00
Fabio Erculiani
956b31d05e [entropy.db.sql] add overridable isMainThread method
a MainThread may be a "liquid" concept. A dedicated worker thread
may be considered a "MainThread" from the point of view of EntropySQLRepository.

_start_cleanup_monitor checks whether the calling thread is the MainThread
in order to determine if a cleanup thread should be started joining
the current thread. The problem with this approach is that if our
worker thread is a long lasting thread, we will end up with hundreds
of cleanup monitor threads waiting for the worker thread to terminate.
This will never happen though.

We can now reimplement isMainThread in order to tell the internal
function not to start the cleanup monitor thread also for arbitrary
threads (like the worker thread in RigoDaemon).
2013-12-31 17:24:24 +01:00
Fabio Erculiani
88ea4c7427 [entropy.client.services] fix typo in HTTP arguments for get_documents()
s/revision/rev/
2013-12-31 17:04:36 +01:00
Fabio Erculiani
af6fa0d32f [entropy.spm] PortagePlugin: add clear() to API, see documentation 2013-12-31 16:52:52 +01:00
Fabio Erculiani
0a9fbaf0df Release Entropy 259 2013-12-31 16:02:38 +01:00
Fabio Erculiani
cf9fc1b947 Release Entropy 258 2013-12-31 15:17:41 +01:00
Fabio Erculiani
0346f74c1a [entropy.client.package] catch InterruptError raised by fetch_abort functions 2013-12-31 12:28:29 +01:00
Fabio Erculiani
c5adbc0b20 Release Entropy 257 2013-12-27 19:21:09 +01:00
Fabio Erculiani
b088df88bd [entropy.cache] EntropyCacher: drop CACHE_IDS (\o/) and clear_cache() 2013-12-27 19:15:20 +01:00
Fabio Erculiani
4fc40101ec [entropy.core.settings.base] drop any explicit clear_cache() call
clear_cache() is no longer required since cache keys are now
correctly generated.
2013-12-27 19:12:05 +01:00
Fabio Erculiani
f7bebcba0f [entropy.core.settings.base] drop _clear_repository_cache(), no longer needed 2013-12-27 19:03:53 +01:00
Fabio Erculiani
1d42427eb1 [entropy.core.settings.base] add license_accept and system_mask to packages_configuration_hash() 2013-12-27 19:02:40 +01:00
Fabio Erculiani
29af516046 [entropy.client.methods] drop _clear_repository_cache() usage
This is no longer needed because cache keys are now properly generated
2013-12-27 18:51:39 +01:00
Fabio Erculiani
df6d28f58f [entropy.client.db] stop using EntropyCacher.CACHE_IDS['mask_filter']
Use atomMatchCacheKey() instead
2013-12-27 18:50:41 +01:00
Fabio Erculiani
6d1f2ab77f [entropy.db.skel] expose atomMatch cache key generation hook
This method adds atomMatchCacheKey() that can be reimplemented
by subclasses in order to cooperatively generate a cache key for
atomMatch calls.
2013-12-27 18:49:21 +01:00
Fabio Erculiani
b2fe272ebf [entropy.client.dep] use ClientSettings.packages_configuration_hash() as part of cache keys 2013-12-27 18:05:29 +01:00
Fabio Erculiani
f31cdb59ff [entropy.client.settings] add packages_configuration_hash()
This method serves the purpose of returning a hash of the current
packages configuration (masking, unmasking, keywording, etc).
This will be used by upper layers as part of cache keys generation.
2013-12-27 17:56:02 +01:00
Fabio Erculiani
68e664c947 [entropy.client.dep] use SystemSettings.packages_configuration_hash() for cache validation 2013-12-27 17:34:23 +01:00
Fabio Erculiani
d461ffa02f [entropy.core.settings.base] introduce packages_configuration_hash()
This method serves the purpose of returning a hash of the current
packages configuration (masking, unmasking, keywording, etc).
This will be used by upper layers as part of cache keys generation.
2013-12-27 17:22:49 +01:00
Fabio Erculiani
1f75376b8e [entropy.cache] drop EntropyCacher.CACHE_IDS['db_match']
This is no longer needed.
2013-12-27 16:44:19 +01:00
Fabio Erculiani
6c9ffc0e59 Release Entropy 256 2013-12-26 23:05:39 +01:00
Fabio Erculiani
2a034e4a05 [entropy.client.methods] add an "unlocked" version of get_package_action() 2013-12-26 22:52:13 +01:00
Fabio Erculiani
11e6d596b8 [entropy.db.sqlite] do not clear the cache if locks are already acquired 2013-12-26 22:52:13 +01:00