##// END OF EJS Templates
chore(deps): bumped celery to 5.3.6 and kombu to latest version
super-admin -
r5297:d8a4789a default
parent child Browse files
Show More
@@ -1,295 +1,295 b''
1 1 # deps, generated via pipdeptree --exclude setuptools,wheel,pipdeptree,pip -f | tr '[:upper:]' '[:lower:]'
2 2
3 3 alembic==1.12.1
4 4 mako==1.2.4
5 5 markupsafe==2.1.2
6 6 sqlalchemy==1.4.51
7 7 greenlet==3.0.3
8 8 typing_extensions==4.9.0
9 9 async-timeout==4.0.3
10 10 babel==2.12.1
11 11 beaker==1.12.1
12 celery==5.3.4
13 billiard==4.1.0
12 celery==5.3.6
13 billiard==4.2.0
14 14 click==8.1.3
15 15 click-didyoumean==0.3.0
16 16 click==8.1.3
17 17 click-plugins==1.1.1
18 18 click==8.1.3
19 19 click-repl==0.2.0
20 20 click==8.1.3
21 21 prompt-toolkit==3.0.38
22 22 wcwidth==0.2.6
23 23 six==1.16.0
24 kombu==5.3.2
25 amqp==5.1.1
24 kombu==5.3.5
25 amqp==5.2.0
26 26 vine==5.1.0
27 27 vine==5.1.0
28 28 python-dateutil==2.8.2
29 29 six==1.16.0
30 30 tzdata==2023.4
31 31 vine==5.1.0
32 32 channelstream==0.7.1
33 33 gevent==23.9.1
34 34 greenlet==3.0.3
35 35 zope.event==5.0.0
36 36 zope.interface==6.1.0
37 37 itsdangerous==1.1.0
38 38 marshmallow==2.18.0
39 39 pyramid==2.0.2
40 40 hupper==1.12
41 41 plaster==1.1.2
42 42 plaster-pastedeploy==1.0.1
43 43 pastedeploy==3.1.0
44 44 plaster==1.1.2
45 45 translationstring==1.4
46 46 venusian==3.0.0
47 47 webob==1.8.7
48 48 zope.deprecation==5.0.0
49 49 zope.interface==6.1.0
50 50 pyramid-apispec==0.3.3
51 51 apispec==1.3.3
52 52 pyramid-jinja2==2.10
53 53 jinja2==3.1.2
54 54 markupsafe==2.1.2
55 55 markupsafe==2.1.2
56 56 pyramid==2.0.2
57 57 hupper==1.12
58 58 plaster==1.1.2
59 59 plaster-pastedeploy==1.0.1
60 60 pastedeploy==3.1.0
61 61 plaster==1.1.2
62 62 translationstring==1.4
63 63 venusian==3.0.0
64 64 webob==1.8.7
65 65 zope.deprecation==5.0.0
66 66 zope.interface==6.1.0
67 67 zope.deprecation==5.0.0
68 68 python-dateutil==2.8.2
69 69 six==1.16.0
70 70 requests==2.28.2
71 71 certifi==2022.12.7
72 72 charset-normalizer==3.1.0
73 73 idna==3.4
74 74 urllib3==1.26.14
75 75 ws4py==0.5.1
76 76 deform==2.0.15
77 77 chameleon==3.10.2
78 78 colander==2.0
79 79 iso8601==1.1.0
80 80 translationstring==1.4
81 81 iso8601==1.1.0
82 82 peppercorn==0.6
83 83 translationstring==1.4
84 84 zope.deprecation==5.0.0
85 85 diskcache==5.6.3
86 86 docutils==0.19
87 87 dogpile.cache==1.3.0
88 88 decorator==5.1.1
89 89 stevedore==5.1.0
90 90 pbr==5.11.1
91 91 formencode==2.1.0
92 92 six==1.16.0
93 93 gunicorn==21.2.0
94 94 packaging==23.1
95 95 gevent==23.9.1
96 96 greenlet==3.0.3
97 97 zope.event==5.0.0
98 98 zope.interface==6.1.0
99 99 ipython==8.14.0
100 100 backcall==0.2.0
101 101 decorator==5.1.1
102 102 jedi==0.19.0
103 103 parso==0.8.3
104 104 matplotlib-inline==0.1.6
105 105 traitlets==5.9.0
106 106 pexpect==4.8.0
107 107 ptyprocess==0.7.0
108 108 pickleshare==0.7.5
109 109 prompt-toolkit==3.0.38
110 110 wcwidth==0.2.6
111 111 pygments==2.15.1
112 112 stack-data==0.6.2
113 113 asttokens==2.2.1
114 114 six==1.16.0
115 115 executing==1.2.0
116 116 pure-eval==0.2.2
117 117 traitlets==5.9.0
118 118 markdown==3.4.3
119 119 msgpack==1.0.7
120 120 mysqlclient==2.1.1
121 121 nbconvert==7.7.3
122 122 beautifulsoup4==4.11.2
123 123 soupsieve==2.4
124 124 bleach==6.1.0
125 125 six==1.16.0
126 126 webencodings==0.5.1
127 127 defusedxml==0.7.1
128 128 jinja2==3.1.2
129 129 markupsafe==2.1.2
130 130 jupyter_core==5.3.1
131 131 platformdirs==3.10.0
132 132 traitlets==5.9.0
133 133 jupyterlab-pygments==0.2.2
134 134 markupsafe==2.1.2
135 135 mistune==2.0.5
136 136 nbclient==0.8.0
137 137 jupyter_client==8.3.0
138 138 jupyter_core==5.3.1
139 139 platformdirs==3.10.0
140 140 traitlets==5.9.0
141 141 python-dateutil==2.8.2
142 142 six==1.16.0
143 143 pyzmq==25.0.0
144 144 tornado==6.2
145 145 traitlets==5.9.0
146 146 jupyter_core==5.3.1
147 147 platformdirs==3.10.0
148 148 traitlets==5.9.0
149 149 nbformat==5.9.2
150 150 fastjsonschema==2.18.0
151 151 jsonschema==4.18.6
152 152 attrs==22.2.0
153 153 pyrsistent==0.19.3
154 154 jupyter_core==5.3.1
155 155 platformdirs==3.10.0
156 156 traitlets==5.9.0
157 157 traitlets==5.9.0
158 158 traitlets==5.9.0
159 159 nbformat==5.9.2
160 160 fastjsonschema==2.18.0
161 161 jsonschema==4.18.6
162 162 attrs==22.2.0
163 163 pyrsistent==0.19.3
164 164 jupyter_core==5.3.1
165 165 platformdirs==3.10.0
166 166 traitlets==5.9.0
167 167 traitlets==5.9.0
168 168 packaging==23.1
169 169 pandocfilters==1.5.0
170 170 pygments==2.15.1
171 171 tinycss2==1.2.1
172 172 webencodings==0.5.1
173 173 traitlets==5.9.0
174 174 orjson==3.9.13
175 175 pastescript==3.4.0
176 176 paste==3.7.1
177 177 six==1.16.0
178 178 pastedeploy==3.1.0
179 179 six==1.16.0
180 180 premailer==3.10.0
181 181 cachetools==5.3.2
182 182 cssselect==1.2.0
183 183 cssutils==2.6.0
184 184 lxml==4.9.3
185 185 requests==2.28.2
186 186 certifi==2022.12.7
187 187 charset-normalizer==3.1.0
188 188 idna==3.4
189 189 urllib3==1.26.14
190 190 psutil==5.9.8
191 191 psycopg2==2.9.9
192 192 py-bcrypt==0.4
193 193 pycmarkgfm==1.2.0
194 194 cffi==1.16.0
195 195 pycparser==2.21
196 196 pycryptodome==3.17
197 197 pycurl==7.45.2
198 198 pymysql==1.0.3
199 199 pyotp==2.8.0
200 200 pyparsing==3.1.1
201 201 pyramid-debugtoolbar==4.11
202 202 pygments==2.15.1
203 203 pyramid==2.0.2
204 204 hupper==1.12
205 205 plaster==1.1.2
206 206 plaster-pastedeploy==1.0.1
207 207 pastedeploy==3.1.0
208 208 plaster==1.1.2
209 209 translationstring==1.4
210 210 venusian==3.0.0
211 211 webob==1.8.7
212 212 zope.deprecation==5.0.0
213 213 zope.interface==6.1.0
214 214 pyramid-mako==1.1.0
215 215 mako==1.2.4
216 216 markupsafe==2.1.2
217 217 pyramid==2.0.2
218 218 hupper==1.12
219 219 plaster==1.1.2
220 220 plaster-pastedeploy==1.0.1
221 221 pastedeploy==3.1.0
222 222 plaster==1.1.2
223 223 translationstring==1.4
224 224 venusian==3.0.0
225 225 webob==1.8.7
226 226 zope.deprecation==5.0.0
227 227 zope.interface==6.1.0
228 228 pyramid-mailer==0.15.1
229 229 pyramid==2.0.2
230 230 hupper==1.12
231 231 plaster==1.1.2
232 232 plaster-pastedeploy==1.0.1
233 233 pastedeploy==3.1.0
234 234 plaster==1.1.2
235 235 translationstring==1.4
236 236 venusian==3.0.0
237 237 webob==1.8.7
238 238 zope.deprecation==5.0.0
239 239 zope.interface==6.1.0
240 240 repoze.sendmail==4.4.1
241 241 transaction==3.1.0
242 242 zope.interface==6.1.0
243 243 zope.interface==6.1.0
244 244 transaction==3.1.0
245 245 zope.interface==6.1.0
246 246 python-ldap==3.4.3
247 247 pyasn1==0.4.8
248 248 pyasn1-modules==0.2.8
249 249 pyasn1==0.4.8
250 250 python-memcached==1.59
251 251 six==1.16.0
252 252 python-pam==2.0.2
253 253 python3-saml==1.15.0
254 254 isodate==0.6.1
255 255 six==1.16.0
256 256 lxml==4.9.3
257 257 xmlsec==1.3.13
258 258 lxml==4.9.3
259 259 pyyaml==6.0.1
260 260 redis==5.0.1
261 261 regex==2022.10.31
262 262 routes==2.5.1
263 263 repoze.lru==0.7
264 264 six==1.16.0
265 265 simplejson==3.19.1
266 266 sshpubkeys==3.3.1
267 267 cryptography==40.0.2
268 268 cffi==1.16.0
269 269 pycparser==2.21
270 270 ecdsa==0.18.0
271 271 six==1.16.0
272 272 sqlalchemy==1.4.51
273 273 greenlet==3.0.3
274 274 typing_extensions==4.9.0
275 275 supervisor==4.2.5
276 276 tzlocal==4.3
277 277 pytz-deprecation-shim==0.1.0.post0
278 278 tzdata==2023.4
279 279 unidecode==1.3.6
280 280 urlobject==2.4.3
281 281 waitress==3.0.0
282 282 weberror==0.13.1
283 283 paste==3.7.1
284 284 six==1.16.0
285 285 pygments==2.15.1
286 286 tempita==0.5.2
287 287 webob==1.8.7
288 288 webhelpers2==2.0
289 289 markupsafe==2.1.2
290 290 six==1.16.0
291 291 whoosh==2.7.4
292 292 zope.cachedescriptors==5.0.0
293 293
294 294 ## uncomment to add the debug libraries
295 295 #-r requirements_debug.txt
@@ -1,93 +1,92 b''
1 1 # Copyright (C) 2010-2023 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
5 5 # (only), as published by the Free Software Foundation.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU Affero General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 #
15 15 # This program is dual-licensed. If you wish to learn more about the
16 16 # RhodeCode Enterprise Edition, including its added features, Support services,
17 17 # and proprietary license terms, please see https://rhodecode.com/licenses/
18 18
19 19 import socket
20 20 import logging
21 21
22 22 import rhodecode
23 23 from zope.cachedescriptors.property import Lazy as LazyProperty
24 24 from rhodecode.lib.celerylib.loader import (
25 25 celery_app, RequestContextTask, get_logger)
26 26 from rhodecode.lib.statsd_client import StatsdClient
27 27
28 28 async_task = celery_app.task
29 29
30 30
31 31 log = logging.getLogger(__name__)
32 32
33 33
34 34 class ResultWrapper(object):
35 35 def __init__(self, task):
36 36 self.task = task
37 37
38 38 @LazyProperty
39 39 def result(self):
40 40 return self.task
41 41
42 42
43 43 def run_task(task, *args, **kwargs):
44 44 import celery
45 45 log.debug('Got task `%s` for execution, celery mode enabled:%s', task, rhodecode.CELERY_ENABLED)
46 46 if task is None:
47 47 raise ValueError(f'Got non-existing task: {task} for execution')
48 48
49 exec_mode = 'sync'
50 49 allow_async = True
51 50
52 51 # if we're already in a celery task, don't allow async execution again
53 52 # e.g task within task
54 53 in_task = celery.current_task
55 54 if in_task:
56 55 log.debug('This task in in context of another task: %s, not allowing another async execution', in_task)
57 56 allow_async = False
58 57 if kwargs.pop('allow_subtask', False):
59 58 log.debug('Forced async by allow_async=True flag')
60 59 allow_async = True
61 60
62 61 t = None
63 62 if rhodecode.CELERY_ENABLED and allow_async:
64 63
65 64 try:
66 65 t = task.apply_async(args=args, kwargs=kwargs)
67 66 log.debug('executing task %s:%s in async mode', t.task_id, task)
68 67 except socket.error as e:
69 68 if isinstance(e, IOError) and e.errno == 111:
70 69 log.error('Unable to connect to celeryd `%s`. Sync execution', e)
71 70 else:
72 71 log.exception("Exception while connecting to celeryd.")
73 72 except KeyError as e:
74 73 log.error('Unable to connect to celeryd `%s`. Sync execution', e)
75 74 except Exception as e:
76 75 log.exception(
77 76 "Exception while trying to run task asynchronous. "
78 77 "Fallback to sync execution.")
79 78
80 79 else:
81 80 log.debug('executing task %s:%s in sync mode', 'TASK', task)
82 81 statsd = StatsdClient.statsd
83 82 if statsd:
84 83 task_repr = getattr(task, 'name', task)
85 84 statsd.incr('rhodecode_celery_task_total', tags=[
86 85 f'task:{task_repr}',
87 86 'mode:sync'
88 87 ])
89 88
90 89 # we got async task, return it after statsd call
91 90 if t:
92 91 return t
93 92 return ResultWrapper(task(*args, **kwargs))
General Comments 0
You need to be logged in to leave comments. Login now