Skip to content

Conversation

@kradalby
Copy link
Collaborator

@kradalby kradalby commented Feb 21, 2022

This PR fixes an issue where we did not ensure that IPs were allocated in a concurrency safe way.

In addition, it makes the integration tests faster (and hopefully more reliable), and if they fail, they "fail fast" and not try to run the whole suite.

@kradalby kradalby changed the title Test if we can join headscale in parallell to speed up Build and test improvements (No CGO) Feb 22, 2022
This commit changes the SQLite dependency to one that does not depend on
CGO. It uses a C-to-Go translated sqlite library that is Pure go.
@kradalby kradalby changed the title Build and test improvements (No CGO) Faster integration test work Feb 22, 2022
current logic is not safe as it will allow an IP that isnt persisted to
the DB to be given out multiple times if machines joins in quick
succession.

This adds a lock around the "get ip" and machine registration and save
to DB so we ensure thiis isnt happning.

Currently this had to be done three places, which is silly, and outlined
in juanfont#294.
@kradalby kradalby changed the title Faster integration test work Fix ip allocation bug, make integration tests faster Feb 25, 2022
@kradalby kradalby marked this pull request as ready for review February 25, 2022 09:04
@kradalby kradalby requested a review from juanfont as a code owner February 25, 2022 09:04
@kradalby
Copy link
Collaborator Author

@juanfont this is also ready :)

@kradalby kradalby closed this Feb 25, 2022
@kradalby kradalby reopened this Feb 25, 2022
@kradalby kradalby merged commit 08c7076 into juanfont:main Feb 25, 2022
@kradalby kradalby deleted the integration-test-concurrent-join branch February 25, 2022 09:37
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