Skip to content

[MISC] fixes for cluster switchover#58

Merged
paulomach merged 4 commits intomainfrom
fix/racing
Apr 22, 2026
Merged

[MISC] fixes for cluster switchover#58
paulomach merged 4 commits intomainfrom
fix/racing

Conversation

@paulomach
Copy link
Copy Markdown
Contributor

@paulomach paulomach commented Apr 20, 2026

On server tests where there's failover/switchover
the test app might hang or be slow reacting, causing tests to timeout.

This tries to improve by:

  • set timeout to avoid hangs on switchover in the cluster
  • proc communicate can return before process terminate
  • _on_endpoints_changed can't resume writes after endpoint change

Tested in: canonical/mysql-operators#251

use sleep to ensure there's no multiple writes process when doing a new
call to start writes right after, e.g. when restarting it
- if config empty, early exit
- defaults zero on error, if endpoint is not ready
@paulomach paulomach added the enhancement New feature, UI change, or workload upgrade label Apr 20, 2026
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label Apr 20, 2026
Comment thread src/charm.py
Comment thread src/charm.py Outdated
Copy link
Copy Markdown
Contributor

@astrojuanlu astrojuanlu left a comment

Choose a reason for hiding this comment

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

Apart from the ongoing discussion, LGTM

Co-authored-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
Signed-off-by: Paulo Machado <paulo.machado@canonical.com>
@paulomach paulomach merged commit b6c5f37 into main Apr 22, 2026
13 checks passed
@paulomach paulomach deleted the fix/racing branch April 22, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, UI change, or workload upgrade Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants