- 
                Notifications
    
You must be signed in to change notification settings  - Fork 32
 
♻️ add rabbitmq interface to long_running_tasks ⚠️🚨 #8198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            GitHK
  merged 139 commits into
  ITISFoundation:master
from
GitHK:pr-osparc-long-running-rabbitmq-client
  
      
      
   
  Aug 22, 2025 
      
    
  
     Merged
                    Changes from 84 commits
      Commits
    
    
            Show all changes
          
          
            139 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      daf740c
              
                removed unrequired
              
              
                 392cc53
              
                refactor fixture
              
              
                 6498e7a
              
                enhanced removal and cancellation
              
              
                 97e8466
              
                fixed shutdown
              
              
                 3bfa295
              
                update comment
              
              
                 2d44252
              
                avoid tests hanging
              
              
                 a77d79d
              
                fixed test timing out
              
              
                 5d60b6a
              
                fixed tests and spedup
              
              
                 19088cd
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 cb90c9e
              
                refactor
              
              
                 fd1cae6
              
                replaced TasksManager with BaseLongRunningManager in lrt_api
              
              
                 a9befe4
              
                renamed cancellation to remove_task
              
              
                 df8636a
              
                fixed hanging test
              
              
                 897ca66
              
                fast cancellation of lrt
              
              
                 18dde52
              
                lrt api refactor
              
              
                 c84389d
              
                extended tests long_running_manager
              
              
                 6ff969d
              
                fixed tests
              
              
                 08f82cc
              
                removed unused
              
              
                 7f24c65
              
                fixed fastapi tests
              
              
                 ae2f4f1
              
                fixed most tests
              
              
                 e317256
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 de9805b
              
                fixed interfaces
              
              
                 14eede7
              
                fixed interface
              
              
                 119b892
              
                makes settings manadatory
              
              
                 f5a8f1b
              
                fixed interface
              
              
                 e664ba8
              
                fixed broken test
              
              
                 5738b65
              
                fixed tests director-v2
              
              
                 84b17df
              
                fixed serialization of result and enhanced registration
              
              
                 fb9ff38
              
                refactor interface for registration
              
              
                 258a979
              
                fixed tests
              
              
                 7815f8d
              
                fixeed tests
              
              
                 372e668
              
                added todo
              
              
                 05b7d05
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 51c455f
              
                fixede failing tests
              
              
                 fa30870
              
                renamed
              
              
                 451e442
              
                fixed tests
              
              
                 bd0dcfe
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 9d8b9ee
              
                mypy
              
              
                 87939ab
              
                fixeed tests
              
              
                 1695f75
              
                fixed tests
              
              
                 d8904de
              
                fixed tests
              
              
                 6b13f67
              
                removed unused
              
              
                 a02f6e3
              
                fixed issues with loops in test
              
              
                 7f6ecda
              
                rename
              
              
                 730f20d
              
                extended timeout period
              
              
                 83ce1e9
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 60ee272
              
                enhanced errors
              
              
                 e9ad6dc
              
                added message
              
              
                 2380c61
              
                removed uncecessary code
              
              
                 82861ce
              
                fixed issue with method registration
              
              
                 d8cfe2e
              
                using correct namespaces to handle requests
              
              
                 b2f3ea5
              
                fixed issues with failing services
              
              
                 793492e
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 37b672e
              
                refactor setup
              
              
                 ba2e2af
              
                fixed tests
              
              
                 817929e
              
                fixed flaky tests
              
              
                 9b14fe5
              
                fixed typos
              
              
                 31853f2
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 7bc16d1
              
                renamed
              
              
                 159ab96
              
                fixes concurrency issue with tests in CI
              
              
                 67f44e3
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 2ae799d
              
                refactor long running manager
              
              
                 f3f0702
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 f95b2f7
              
                alliged all names as in #8220
              
              
                 5edf2f2
              
                using relative imports
              
              
                 e526943
              
                simplified start_task interface
              
              
                 c30c122
              
                fixed description
              
              
                 28f9e62
              
                moved RedisNamespace in models
              
              
                 a9cc987
              
                replaced both namespaces with only a single one
              
              
                 4224e13
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 8ce988a
              
                removed unsued module
              
              
                 5e31621
              
                rename interface
              
              
                 9e246d6
              
                fixed error formatting
              
              
                 ef3b687
              
                rephrased
              
              
                 bb92891
              
                refactor naming
              
              
                 2a34259
              
                docstring rename
              
              
                 a10f065
              
                removed
              
              
                 56f201a
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 a3ed827
              
                rename
              
              
                 3086829
              
                fix pylint?
              
              
                 187d78f
              
                revert change
              
              
                 95cd9d5
              
                made modules flat
              
              
                 7d6d885
              
                removed _models
              
              
                 984846e
              
                fixed ciruclar dependency
              
              
                 d4e0ef8
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 3863e9c
              
                renamed
              
              
                 5559e6d
              
                renamed
              
              
                 eb1826c
              
                rename
              
              
                 18be3a4
              
                correct decorator order
              
              
                 9200ba1
              
                fixed flaky test removing tasks tha have not been started
              
              
                 d510c8e
              
                fixed tests
              
              
                 6a0d40c
              
                fixed wrong usage
              
              
                 3e62d90
              
                corrected tests
              
              
                 fbf229d
              
                corrected tests
              
              
                 b432be3
              
                let app initialize
              
              
                 3f76411
              
                explicit wait for removal
              
              
                 f160ddb
              
                removal does not wait for task to be removed and supports a timeout
              
              
                 d5dab8f
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 888efc8
              
                added missing
              
              
                 afde03d
              
                refactor error translaton layer to accepet specific error classes only
              
              
                 36a24bd
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 ba0cafd
              
                pylint
              
              
                 d878b17
              
                refactored error registration and detection
              
              
                 46cd3b3
              
                refactor
              
              
                 ca0bca2
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 4d8d93d
              
                fixed tests
              
              
                 e110883
              
                added note
              
              
                 a48bd02
              
                removed unused
              
              
                 4a7341a
              
                rename
              
              
                 6552ddf
              
                fixed public lrt_api interface
              
              
                 2d7e587
              
                updated docstrings
              
              
                 7b26893
              
                updated docstrings
              
              
                 8cfffb4
              
                fixed namesapce
              
              
                 d1fad6f
              
                fixed broken sidecar
              
              
                 4dd8535
              
                avoid tests form hanging
              
              
                 0d3208e
              
                renamed
              
              
                 4bf6d63
              
                renamed
              
              
                 407fa83
              
                fixed interfaces
              
              
                 3095ba6
              
                rename
              
              
                 6747133
              
                reverted changes
              
              
                 1add852
              
                remove unused
              
              
                 6fe3901
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 501a672
              
                changed how error is transferred
              
              
                 01be053
              
                refactor
              
              
                 2dfe2fc
              
                renamed
              
              
                 e3f4bcd
              
                changed error raising
              
              
                 f8785db
              
                renamed
              
              
                 2c77471
              
                fixed broken tests
              
              
                 ba77f87
              
                Merge branch 'master' into pr-osparc-long-running-rabbitmq-client
              
              
                GitHK 1a9d1eb
              
                updated specs
              
              
                 89fbc25
              
                renamed modules
              
              
                 07c4ad1
              
                Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
              
              
                 66c5dde
              
                removed relative imports
              
              
                 5ca6a58
              
                feedback
              
              
                 e8a8052
              
                Merge branch 'pr-osparc-long-running-rabbitmq-client' of github.com:G…
              
              
                 ddac38f
              
                fixed test
              
              
                 5e0efab
              
                fixed issue
              
              
                 6032282
              
                Merge branch 'master' into pr-osparc-long-running-rabbitmq-client
              
              
                GitHK 9fc652a
              
                fixed borken tests
              
              
                 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            14 changes: 14 additions & 0 deletions
          
          14 
        
  packages/pytest-simcore/src/pytest_simcore/long_running_tasks.py
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from datetime import timedelta | ||
| 
     | 
||
| import pytest | ||
| from pytest_mock import MockerFixture | ||
| 
     | 
||
| 
     | 
||
| @pytest.fixture | ||
| async def fast_long_running_tasks_cancellation( | ||
| mocker: MockerFixture, | ||
| ) -> None: | ||
| mocker.patch( | ||
| "servicelib.long_running_tasks.task._CANCEL_TASKS_CHECK_INTERVAL", | ||
| new=timedelta(seconds=1), | ||
| ) | 
        
          
  
    
      
          
            29 changes: 0 additions & 29 deletions
          
          29 
        
  packages/service-library/src/servicelib/aiohttp/long_running_tasks/_manager.py
  
  
      
      
   
        
      
      
    
                              
      
                  GitHK marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
            
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            5 changes: 1 addition & 4 deletions
          
          5 
        
  packages/service-library/src/servicelib/aiohttp/profiler_middleware.py
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
  
    
      
          
            32 changes: 1 addition & 31 deletions
          
          32 
        
  packages/service-library/src/servicelib/fastapi/long_running_tasks/_manager.py
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,35 +1,5 @@ | ||
| import datetime | ||
| 
     | 
||
| from fastapi import FastAPI | ||
| from settings_library.redis import RedisSettings | ||
| 
     | 
||
| from ...long_running_tasks.base_long_running_manager import BaseLongRunningManager | ||
| from ...long_running_tasks.task import RedisNamespace, TasksManager | ||
| 
     | 
||
| 
     | 
||
| class FastAPILongRunningManager(BaseLongRunningManager): | ||
| def __init__( | ||
| self, | ||
| app: FastAPI, | ||
| stale_task_check_interval: datetime.timedelta, | ||
| stale_task_detect_timeout: datetime.timedelta, | ||
| redis_settings: RedisSettings, | ||
| redis_namespace: RedisNamespace, | ||
| ): | ||
| self._app = app | ||
| self._tasks_manager = TasksManager( | ||
| stale_task_check_interval=stale_task_check_interval, | ||
| stale_task_detect_timeout=stale_task_detect_timeout, | ||
| redis_settings=redis_settings, | ||
| redis_namespace=redis_namespace, | ||
| ) | ||
| 
     | 
||
| @property | ||
| def tasks_manager(self) -> TasksManager: | ||
| return self._tasks_manager | ||
| 
     | 
||
| async def setup(self) -> None: | ||
| await self._tasks_manager.setup() | ||
| 
     | 
||
| async def teardown(self) -> None: | ||
| await self._tasks_manager.teardown() | ||
| pass | ||
                
      
                  GitHK marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.