Commit Graph
36981 Commits
Author SHA1 Message Date
Lucille Delisle 26091203c2 lint 2024-01-26 21:07:07 +01:00
Lucille Delisle a88be0dd22 improve test 2024-01-26 20:27:12 +01:00
Lucille Delisle 576a4047ed fix workflow syntax 2024-01-26 19:44:15 +01:00
Lucille Delisle b091599c1f fix comment on test_keep_success_mapping_error 2024-01-26 19:43:16 +01:00
mvdbeek e5ade6ea21 WIP: fix KEEP_SUCCESS for non-terminal inputs 2024-01-25 16:55:30 +01:00
Lucille Delisle ca13bcd055 requires a semi-terminal state 2024-01-25 16:21:22 +01:00
Lucille Delisle 15c923d57d fix typo in test 2024-01-25 16:21:21 +01:00
Lucille Delisle 03d6ca8dea add __KEEP_SUCCESS_DATASETS__ 2024-01-25 16:21:19 +01:00
Nicola Soranzo 12ad482d66 Fix B038 errors reported by flake8-bugbear 24.1.17 2024-01-22 20:33:47 +00:00
Nicola Soranzo fd5102dd1d Fix B036 errors reported by flake8-bugbear 24.1.17 2024-01-22 20:33:46 +00:00
Nicola Soranzo a11f77d4be Merge pull request #17335 from davelopez/fix_quotas_id_encoding
Fix quotas ID encoding
2024-01-22 18:34:38 +00:00
davelopez 0b4df0f37b Fix quotas id encoding 2024-01-22 12:23:56 +01:00
Ubuntu 6860c9a0fb Add support for Python 3.12 2024-01-21 11:57:59 +00:00
Nicola Soranzo 30a6aab6c9 Workaround `ImportError for importlib.resources.Anchor`
xref: https://github.com/python/cpython/issues/113238
2024-01-21 10:31:16 +00:00
Nicola Soranzo 76e566d1e1 Fix E231 flake8 error in f-string 2024-01-21 10:31:16 +00:00
Ubuntu cc878ba75f Update comments 2024-01-20 22:12:06 +00:00
Björn Grüning 5f25a48ac9 Merge pull request #17311 from bgruening/s3fs-templating
[23.2] fix s3fs templating
2024-01-20 10:56:38 +01:00
nuwang 000246826e Also pop bucket name during get and write to filesource 2024-01-19 22:50:07 +05:30
Marius van den Beek f12984bf37 Merge pull request #17324 from pcm32/patch-13
Enable job resubmissions in k8s runner
2024-01-18 14:59:45 +01:00
mvdbeek e02a765b7b Merge branch 'release_23.2' into dev 2024-01-18 12:23:00 +01:00
Bjoern Gruening 29d7820cb3 fix linting 2024-01-18 11:42:17 +01:00
Bjoern Gruening a75422d9c8 ls() can not handle the bucket in its arguments 2024-01-18 11:38:59 +01:00
nuwang 7392c6b70d Move _bucket initializer to open_fs, following GoogleCloudStorageFilesSource 2024-01-18 11:36:30 +01:00
Björn Grüning 625ae9700f bucket needs special handling 2024-01-18 11:36:30 +01:00
Björn Grüning 488d2838e9 Update s3fs.py 2024-01-18 11:36:30 +01:00
Björn Grüning 89f02ff060 fix s3fs templating 2024-01-18 11:36:30 +01:00
mvdbeek e55a09955b Scope session for job runner monitor loop
I think this is as closed as we can get to
```
try:
    <use session>
    session.commit()
except:
   session.rollback()
   raise
finally:
   session.close()  # optional, depends on use case
```
mentioned in https://docs.sqlalchemy.org/en/14/faq/sessions.html#this-session-s-transaction-has-been-rolled-back-due-to-a-previous-exception-during-flush-or-similar
2024-01-17 18:19:04 +01:00
John Davis b9ba44bc10 Merge pull request #17315 from mvdbeek/backport_23.2_pendingrollbackerror2
[23.2] Backport Rollback invalidated transaction: catch them earlier
2024-01-17 09:28:08 -05:00
mvdbeek a88dbdd177 Discard connection after task completion
Running the test without removing the session yields:
```
celery.app.trace ERROR 2024-01-17 11:49:42,502 [pN:main,p:81158,tN:Thread-2 (start)] Task integration.test_celery_tasks.use_session[0f89df2c-4960-4aac-8e1a-ce431dae6749] raised unexpected: PendingRollbackError("Can't reconnect until invalid transaction is rolled back.")
Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/lib/galaxy/celery/__init__.py", line 181, in wrapper
    rval = app.magic_partial(func)(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/lagom/wrapping.py", line 28, in _bound_func
    return inner_func(*bound_args, **bound_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/lagom/wrapping.py", line 45, in _error_handling_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/test/integration/test_celery_tasks.py", line 42, in use_session
    sa_session().query(HistoryDatasetAssociation).get(1)
  File "<string>", line 2, in get
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 468, in warned
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 947, in get
    return self._get_impl(ident, loading.load_on_pk_identity)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/query.py", line 951, in _get_impl
    return self.session._get_impl(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2975, in _get_impl
    return db_load_fn(
           ^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/loading.py", line 530, in load_on_pk_identity
    session.execute(
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
    conn = self._revalidate_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 650, in _revalidate_connection
    self._invalid_transaction()
  File "/Users/mvandenb/src/galaxy/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 622, in _invalid_transaction
    raise exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)
FAILEDINFO:     127.0.0.1:59776 - "GET /api/jobs?state=running HTTP/1.1" 200 OK
```

The fix here is to set a unique scope for the session registry.
This means that the task is guranteed to get a new, unshared session,
and this session gets removed after completing the task.

The docstring of session.remove says:
```
       This will first call :meth:`.Session.close` method
        on the current :class:`.Session`, which releases any existing
        transactional/connection resources still being held; transactions
        specifically are rolled back.  The :class:`.Session` is then
        discarded.   Upon next usage within the same scope,
        the :class:`.scoped_session` will produce a new
        :class:`.Session` object.
```
which I think is what we want after every celery task (for now, at least).
It might make sense to discard the session for any long-running task
that doesn't require database access in the future.

Fix scope
2024-01-17 12:41:43 +01:00
mvdbeek 274a1549be Merge branch 'release_23.2' into dev 2024-01-17 10:59:22 +01:00
mvdbeek 8118f07d81 Merge branch 'release_23.1' into release_23.2 2024-01-17 10:57:25 +01:00
John Davis a4d0c33972 Remove redundant db connection check 2024-01-17 10:54:10 +01:00
John Davis 9bae0a06a4 Check db connection for invalid transactions in runner's monitor loop 2024-01-17 10:54:09 +01:00
John Davis 34fd0bdeee Merge pull request #17312 from jdavcs/23.2_pendingrollbackerror2
[23.2] Rollback invalidated transaction: catch them earlier
2024-01-16 17:36:20 -05:00
John Davis c744ca3ae0 Remove redundant db connection check 2024-01-16 15:54:20 -05:00
John Davis e24ed35452 Check db connection for invalid transactions in runner's monitor loop 2024-01-16 15:48:06 -05:00
Marius van den BeekandNicola Soranzo 6c42b169e9 Fix kombu version
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2024-01-16 19:13:25 +01:00
mvdbeek b7f90ec87d Install newer celery on python 3.8+
Latest celery fixes exception reporting, but doesn't work on python 3.7.
I'm only adding this to {pinned,dev}-requirements.txt. When merging forward
we can drop the 3.7 dependency.
2024-01-16 19:08:39 +01:00
John Chilton c7737c4c4b Allow configuring a different store for job files tus staging. 2024-01-16 10:11:30 -05:00
John Chilton 686bc926d6 Fix job_files decorators for TUS 2.0 2024-01-16 10:04:25 -05:00
John Chilton 0953118f9a Allow job files to consume TUS uploads 2024-01-16 10:03:02 -05:00
Marius van den Beek 7f057c9331 Merge pull request #17268 from mvdbeek/fix_element_not_copied
[23.1] Always copy datasets in collection builder modals
2024-01-16 14:58:12 +01:00
Tillman fa69fd150c Add deprecated path to index_workflow_invocations operation 2024-01-16 12:52:07 +01:00
Tillman d1487e98b7 Include deprecated route in tests 2024-01-16 12:52:07 +01:00
Tillman d9b663d2f0 Remove comments 2024-01-16 12:52:07 +01:00
Tillman b6186cc284 Refine pydantic models 2024-01-16 12:52:07 +01:00
Tillman 1f561c31c5 Fix typing 2024-01-16 12:52:07 +01:00
Tillman bd42cd0db3 Fix typing 2024-01-16 12:52:07 +01:00
Tillman ac7e7a86c2 Resolve merge mistakes 2024-01-16 12:52:07 +01:00
Tillman 0d375fd413 Revert some changes 2024-01-16 12:52:07 +01:00