Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

stop using goprocess for shutdown #38

Merged
merged 3 commits into from
Sep 25, 2021
Merged

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Sep 19, 2021

I really wish the original author of this library had written tests. Making a change like this without any tests feels extremely brittle.

@Stebalien
Copy link
Member

I really wish the original author of this library had written tests. Making a change like this without any tests feels extremely brittle.

Yeah, we've been bitten by silent bugs here in the past. Testing end-to-end is tricky, but it should be possible to test parts of this library, at least.

mapping.go Outdated Show resolved Hide resolved
nat.mappings[m] = struct{}{}
nat.refCount.Add(1)
nat.mappingmu.Unlock()
go nat.refreshMappings(m)
Copy link
Member

Choose a reason for hiding this comment

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

If it's not too difficult, it would be nice to have a single worker loop to handle refreshing mappings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, it's not that easy, because of the way that mapping and nat are coupled. Not sure I want to make such a change in a repo where we don't have any tests...

@marten-seemann marten-seemann merged commit a782396 into master Sep 25, 2021
@marten-seemann marten-seemann deleted the remove-goprocess branch September 25, 2021 14:10
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants