Skip to content

refactor kinesis state lifecycle hook#7825

Merged
thrau merged 1 commit intomasterfrom
fix-kinesis-lifecycle-hook
Mar 9, 2023
Merged

refactor kinesis state lifecycle hook#7825
thrau merged 1 commit intomasterfrom
fix-kinesis-lifecycle-hook

Conversation

@thrau
Copy link
Member

@thrau thrau commented Mar 8, 2023

This PR refactors our Kinesis provider to use the new state lifecycle hooks.

  • Encapsulate starting and stopping of account-specific kinesis-mock backends into KinesisServerManager
  • Implements the state lifecycle hook methods to properly shut down the managed kinesis backends
    • on_before_state_load: before a state load, we only need to shut down already running kinesis backends. the kinesis backends are re-started lazily the next time they are requested.
    • same with on_before_state_reset
    • on_before_stop just shuts them down

tested manually with the new persistence plugin using localstack-ext

@thrau thrau requested a review from giograno March 8, 2023 23:59
@thrau thrau temporarily deployed to localstack-ext-tests March 8, 2023 23:59 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

LocalStack integration with Pro

       3 files  +    2         3 suites  +2   1h 31m 2s ⏱️ + 18m 14s
1 783 tests +  16  1 402 ✔️ +  26  381 💤  -   10  0 ±0 
2 509 runs  +742  1 778 ✔️ +402  731 💤 +340  0 ±0 

Results for commit 9dd06d6. ± Comparison against base commit 3224002.

return f"http://{LOCALHOST}:{server.port}"

@staticmethod
def get_store(account_id: str, region_name: str) -> KinesisStore:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a quick look at the kinesis stores. Are we using them somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, i didn't actually look into it. but may be useful to keep it

@thrau thrau merged commit cf6dbfb into master Mar 9, 2023
@thrau thrau deleted the fix-kinesis-lifecycle-hook branch March 9, 2023 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants