Skip to content

Conversation

@ledbruno
Copy link
Contributor

@ledbruno ledbruno commented Jul 18, 2024

Proposed changes

On a scenario with multiple infrastructures connecting to a "main" chaoscenter/portal, we can have websocket disconnection cases. In those scenarios the subscriber exit with -1 code and pod is restarted, but fails to restablish connection because server responds ALREADY_CONNECTED.

We are proposing to changes

Subscriber

  1. should disconnect with panic, so ws connection (which is defered) can be called.
  2. should exit when receives an ALREADY CONNECTED message from the server, since it should retry

Portal/chaosCenter

  1. Should close previous channel and return ALREADY connected error. That will trigger ctc.Done() and cleanup in-memory map with connected infras, so a subscriber restart will be able to connect again.

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

ledbruno added 2 commits July 18, 2024 09:36
Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
@ledbruno ledbruno marked this pull request as ready for review July 18, 2024 13:59
@amityt amityt requested review from Saranya-jena, amityt and imrajdas and removed request for amityt July 22, 2024 07:11
Copy link
Contributor

@amityt amityt left a comment

Choose a reason for hiding this comment

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

LGTM

@Saranya-jena Saranya-jena merged commit fd9cb3f into litmuschaos:master Aug 14, 2024
kwx4957 pushed a commit to kwx4957/litmus that referenced this pull request Sep 1, 2024
* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

---------

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
andoriyaprashant pushed a commit to andoriyaprashant/litmus that referenced this pull request Sep 7, 2024
* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

---------

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
andoriyaprashant pushed a commit to andoriyaprashant/litmus that referenced this pull request Sep 7, 2024
* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

---------

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
sagnik3788 pushed a commit to sagnik3788/litmus that referenced this pull request Oct 5, 2024
* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

* Force infra/subscriber disconnection when is already connected

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>

---------

Signed-off-by: Bruno Ledesma <led.bruno@gmail.com>
Signed-off-by: sagnik3788 <116512372+sagnik3788@users.noreply.github.com>
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.

4 participants