Skip to content

Cancel the listener context before closing it#74

Merged
masnax merged 1 commit into
canonical:mainfrom
masnax:fix-ctx
Nov 24, 2023
Merged

Cancel the listener context before closing it#74
masnax merged 1 commit into
canonical:mainfrom
masnax:fix-ctx

Conversation

@masnax
Copy link
Copy Markdown
Contributor

@masnax masnax commented Nov 23, 2023

Fixes a misleading error log because we were closing the listeners but not closing their contexts.

Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
@masnax masnax requested a review from roosterfish November 23, 2023 22:50
Copy link
Copy Markdown
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I was wondering why MicroCloud starts up the servers again after the init process went through? Essentially I don't get who is calling Serve() again. Can you please elaborate on this?

@masnax
Copy link
Copy Markdown
Contributor Author

masnax commented Nov 24, 2023

Looks good to me.

I was wondering why MicroCloud starts up the servers again after the init process went through? Essentially I don't get who is calling Serve() again. Can you please elaborate on this?

It's an accommodation for MicroCloud, mostly. In order to fetch the disks/interfaces on each system, and also instruct the systems to actually join the cluster, we need to be able to talk to them remotely. So there is an option in microcluster to specify a port which will be used to open a listener on all addresses. Then when MicroCloud has determined which subnet it wants to use for the cluster, it tears down the wildcard listener on each system and replaces it with a proper address:port combo.

@roosterfish
Copy link
Copy Markdown
Contributor

Ah ok, and that is the reason why there is the err="accept tcp [::]:9443: wildcard in the error message which indicates the first listener that isn't used anymore. Thanks!

@masnax masnax merged commit 1491142 into canonical:main Nov 24, 2023
masnax added a commit to masnax/microcluster that referenced this pull request Dec 10, 2024
Cancel the listener context before closing it

(cherry picked from commit 1491142)
masnax added a commit to masnax/microcluster that referenced this pull request Dec 10, 2024
Cancel the listener context before closing it

(cherry picked from commit 1491142)
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
masnax added a commit to masnax/microcluster that referenced this pull request Dec 11, 2024
Cancel the listener context before closing it

(cherry picked from commit 1491142)
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.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.

2 participants