Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins: each plugin instance now has its own state #159

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Insei
Copy link

@Insei Insei commented Sep 25, 2022

Now each plugin setup has its own state

If we use coreDHCP as a library and run multiple servers, we can't separate plugin variables for each server. This PR fix this problem.

Signed-off-by: Dmitrii Aleksandrov goodmobiledevices@gmail.com

* If we use coreDHCP as a library and run multiple servers, we can't separate configs variables for each server. This commit fix this problem.

Signed-off-by: Dmitrii Aleksandrov <goodmobiledevices@gmail.com>
@Adphi Adphi mentioned this pull request Oct 2, 2022
Copy link
Member

@Natolumin Natolumin left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
That's definitely a direction we want to go into so this is very appreciated. Do you have ideas maybe for tests we could have to avoid regressions on this point ?

I've left a couple notes inline for minor code notes, but this is probably fine to merge with minor changes once I get the time to test it a little

plugins/file/plugin_test.go Outdated Show resolved Hide resolved
plugins/file/plugin.go Show resolved Hide resolved
plugins/mtu/plugin.go Outdated Show resolved Hide resolved
plugins/mtu/plugin.go Show resolved Hide resolved
plugins/mtu/plugin_test.go Outdated Show resolved Hide resolved
plugins/searchdomains/plugin.go Outdated Show resolved Hide resolved
plugins/staticroute/plugin.go Outdated Show resolved Hide resolved
plugins/staticroute/plugin.go Show resolved Hide resolved
plugins/staticroute/plugin_test.go Outdated Show resolved Hide resolved
plugins/serverid/plugin.go Outdated Show resolved Hide resolved
@Insei Insei requested a review from Natolumin October 6, 2022 06:29
@Insei Insei force-pushed the multiple_servers branch 5 times, most recently from 66a7525 to f2e5837 Compare October 6, 2022 07:05
@Insei
Copy link
Author

Insei commented Oct 6, 2022

Okay, i think it's ready.
I fixed all the remarks, and fixed some tests.

All pluginState's is private now, and not used in tests. All pluginState methods has pointer recievers.

I also changed the plugin's server_id test, it's not entirely clear why UUID DUID's are tested if they are not supported by the plugin. I can't even call setup method with UUID DUID. Therefore, I redid all the tests for LL DUID and LLT DUID.

@Insei
Copy link
Author

Insei commented Oct 6, 2022

Thanks for the PR!
That's definitely a direction we want to go into so this is very appreciated. Do you have ideas maybe for tests we could have to avoid regressions on this point ?

Sorry, i simple use this project. I also don't have any particular performance requirements. I just liked this project more than others, and I took up its revision to fit my needs.

Within 2-3 months, there will be a reality check, if the servers work well, then I will redo the logging.

* And do not use the internal structures of the plugins
* Small fixes

Signed-off-by: Aleksandrov Dmitriy <goodmobiledevices@gmail.com>
@Insei
Copy link
Author

Insei commented Dec 14, 2022

@Natolumin any update? Can we merge this or no?

@dulitz
Copy link

dulitz commented Feb 9, 2023

I have a few more plugins I'd like to upstream. Personally I think this PR goes in the right direction so I'd like to see it merged. But when it's merged I'll have to make changes to my plugins so I'd like to know one way or another.

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.

None yet

3 participants