Commit graph

176 commits

Author SHA1 Message Date
Tomas Kopecek
562b325c8c kojira: use thread-local session object
Fixes: https://pagure.io/koji/issue/2854
2021-05-17 08:58:56 +02:00
Tomas Kopecek
11e71e867a kojira: don't fail on already deleted repo
Related: https://pagure.io/koji/issue/2851
2021-05-17 08:58:09 +02:00
Tomas Kopecek
3849e07ecf kojira: skip unlocking of child locks
Related: https://pagure.io/koji/issue/2851
2021-05-17 08:57:24 +02:00
Tomas Kopecek
1bd62ab607 kojira: faster startup
caching tags in the start + caching property for getting inheritance

Fixes: https://pagure.io/koji/issue/2612
2021-05-10 09:49:55 +02:00
Alex Iribarren
2b83d458c6 Tolerate floats in metadata timestamps 2021-03-30 14:49:22 +02:00
Tomas Kopecek
1a76030707 kojira: check repo.json before deleting
Fixes: https://pagure.io/koji/issue/1321
2021-03-23 13:47:48 +01:00
Tomas Kopecek
e83dd2757e kojira: check rm queue before adding new path
It is a remnant of previsou unification of rmtree paths. Instead of
deleting tree directly while deleting repo it is put into queue now. So,
other thread looking for expired/deleted repos can find it also and add
it twice. Internal rmtree can check the queue before adding duplicate
path. As a side-effect manager.rmtree can also never fail, so try/except
can be removed from there.

Fixes: https://pagure.io/koji/issue/2716
2021-03-18 15:33:31 +01:00
Mike McLean
3c9dc70832 acquire logging locks before forking
Fixes https://pagure.io/koji/issue/2714
2021-03-11 13:31:35 +01:00
Tomas Kopecek
912ee6f12b remove unused variable 2021-02-04 16:16:31 +01:00
Tomas Kopecek
3f82779581 allow other thread to remove tag 2021-02-04 16:16:31 +01:00
Tomas Kopecek
2d867fa730 remove recent tasks behaviour 2021-02-04 16:16:31 +01:00
Tomas Kopecek
d44af4cbb7 move checkTasks near its usage
Related: https://pagure.io/koji/issue/2119
Fixes: https://pagure.io/koji/issue/2581
2021-02-04 16:16:31 +01:00
Tomas Kopecek
96ae0ecef5 explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
2021-01-26 13:36:25 +01:00
Tomas Kopecek
0f56d39487 remove deprecated --ca option
Fixes: https://pagure.io/koji/issue/2192
2020-11-23 11:03:38 +01:00
Mike McLean
267eff9636 handle arches=None case
Should handle all these "empty" cases: missing, None, blank string, only whitespace
2020-11-05 10:31:04 +01:00
Mike McLean
28d07c11ba make cache key consistent 2020-11-05 10:31:04 +01:00
Mike McLean
49e54eb7d2 minor logging adjustment 2020-11-05 10:31:04 +01:00
Mike McLean
efd5e3f48a kojira: cache external repo timestamps by arch_url
Fixes: https://pagure.io/koji/issue/2532
2020-11-05 10:31:04 +01:00
Tomas Kopecek
6a21354006 remove instance variables 2020-10-29 15:11:57 +01:00
Tomas Kopecek
412a29bb88 kojira: don't expire ignored tags with targets
Fixes: https://pagure.io/koji/issue/2542
2020-10-29 15:11:57 +01:00
Tomas Kopecek
e711e7dbe5 utils in py3 2020-10-06 15:00:23 +02:00
Tomas Kopecek
2e042db3af kojira: parallelize rmtree
Fixes: https://pagure.io/koji/issue/2398
2020-08-26 09:32:50 +02:00
Tomas Kopecek
f06a8c0bca fix flake8 errors 2020-08-25 13:05:02 +02:00
Yu Ming Zhu
92dd493e98 add delete_batch_size into legacy_opts 2020-07-27 08:59:40 +00:00
Yu Ming Zhu
2aa7ff67bb kojira: remove unused delete_batch_size
fixes: #2396
2020-07-27 08:58:42 +00:00
Mike McLean
7afc7628ad kojira: drop reference to krb_login
this call to krb_login was accidentally re-introduced with a merge commit.

Fixes https://pagure.io/koji/issue/2400
2020-07-24 17:21:08 -04:00
Simo Sorce
2c663f0b73 Use requests_gssapi instead of requests_kerberos
Retain ability to use the old requests_kerberos where request_gssapi is
not available yet.

Signed-off-by: Simo Sorce <simo@redhat.com>
2020-07-24 15:32:42 -04:00
Tomas Kopecek
f8419e3626 remove deprecated krbV support
Fixes: https://pagure.io/koji/issue/1991
2020-07-24 15:08:47 -04:00
Tomas Kopecek
40a55908ab kojira: estimate better expire_ts 2020-07-24 13:40:26 +02:00
Tomas Kopecek
74f18b687e kojira: threaded repo deletion
Fixes: https://pagure.io/koji/issue/2336
2020-07-24 13:40:26 +02:00
Tomas Kopecek
bc378d1775 more debug info for un/tracked tasks in kojira
Relates: https://pagure.io/koji/issue/2119
2020-06-24 14:56:52 +02:00
Tomas Kopecek
2baa24bd4e kojira: replace deprecated Thread.isAlive()
From py 2.7 exists an alias is_alive, so it is safe to replace it.

Fixes: https://pagure.io/koji/issue/2312
2020-06-18 15:35:51 +02:00
Nils Philippsen
ffd282031d Fix logic detecting directories
Signed-off-by: Nils Philippsen <nils@redhat.com>
2020-06-16 17:39:01 +02:00
Tomas Kopecek
0f69eabee1 kojira: swap first_seen with latest mtime for repo
first_seen is measured from start of the kojira process. This is
inconsistent between runs and short-lived processes will never delete
some repos. Replace it with mtime of repo directory, it still should be
sufficient indicator of age (if it exists).

Fixes: https://pagure.io/koji/issue/2139
2020-06-16 11:17:24 +02:00
Tomas Kopecek
1bf711347f kojira: use cached getTag for external repos
Fixes: https://pagure.io/koji/issue/2156
2020-05-13 12:51:31 +02:00
Tomas Kopecek
58ef1338a8 fix flake8 2020-04-22 14:52:37 +02:00
Tomas Kopecek
539e024257 kojira: queue status file
Fixes: https://pagure.io/koji/issue/2023
2020-04-22 13:53:08 +02:00
Tomas Kopecek
0132313f92 replace logging.warn with warning
call is deprected in python 3.7

Fixes: https://pagure.io/koji/issue/2135
2020-04-22 13:47:15 +02:00
Tomas Kopecek
3aca7b43a6 turn off checking external repos by default
Fixes: https://pagure.io/koji/issue/2159
2020-04-21 10:31:24 +02:00
Igor Raits
f232e49194
Set default keytab for kojira
kojid and other services koji provide have default keytab, there is no
reason why kojira should not have this.

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-04-03 18:00:16 +02:00
Tomas Kopecek
713e657555 remove incomprehensible check 2020-04-02 10:35:16 +02:00
Tomas Kopecek
751862f1b1 kojira monitors external repos changes
Fixes: https://pagure.io/koji/issue/512
2020-04-02 10:35:16 +02:00
Mike McLean
208ec10f92 kojira: be tolerant of old with_src configuration option
Fixes https://pagure.io/koji/issue/2120
2020-04-02 10:31:41 +02:00
Igor Raits
e46fffe26b kojira: Allow using Kerberos without krbV
"Error: Unknown login error" message is very misleading because no
authentication is being performed when krbV is not installed.

Quit with error message if no authentication has been performed and also
update such error message in kojid to mentioned cert auth.

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-04-01 15:02:18 +02:00
Tomas Kopecek
c899049fac reverse score ordering for tags
Fixes: https://pagure.io/koji/issue/2021
2020-03-26 14:26:42 +01:00
Yuming Zhu
d21083a11b still use BaseException for logging purpose 2020-03-03 21:38:22 +08:00
Yuming Zhu
cf34706f04 use Exception instead of BaseException for bare expection 2020-03-03 21:38:22 +08:00
Yuming Zhu
2a2c5cb729 flake8: apply W rules (prefering W503) 2020-03-03 21:38:22 +08:00
Yuming Zhu
c5db34a8e1 flake8: apply E501 with max-line-length=99 2020-03-03 21:38:22 +08:00
Yuming Zhu
f1ba6cefd7 flake8: apply all rest E7 rules 2020-03-03 21:38:22 +08:00