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

Python module: support multiple instances #6

Merged

Conversation

@episource
Copy link
Contributor

commented Apr 30, 2018

Currently, it's not possible to use multiple instances of the python module. Nevertheless, adding the word python to the module-config: option several times is not rejected by unbound. In the end, however, it's not a usable setup supported by unbound.

The proposed solution allows to reference the python module more than once within module-config: option. For each instance, a python-script: option needs to be added to the python: section, specifying the python script file to be used. The first python module picks up the first python-script: option, the second picks up the second script, and so on.

I've been successfully using this patch with unbound-1.6.0, 1.6.1, 1.6.4 and 1.7.0.

See also: https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=1213
(Pull-Requests were disabled when I created this ticket)

@episource

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2018

If you are willing to accept all of the pull requests #4, #5, #6, you could also consider merging dev/all-merged/master instead: All three patches have been merged into this single branch.

@episource episource force-pushed the episource:dev/pythonmod-multi-instance/master branch from 9f6a8fc to 52a6e68 May 5, 2018

@episource episource force-pushed the episource:dev/pythonmod-multi-instance/master branch from 52a6e68 to aa0d9d5 Nov 5, 2018

@episource episource force-pushed the episource:dev/pythonmod-multi-instance/master branch from aa0d9d5 to 42b84d9 Mar 2, 2019

episource added 2 commits Jan 22, 2017
Support multiple python module instances
This commit adds proper support for multiple instances of the python
module: When more than one instance is added to the module list, the
first instance loads the first script specified in the `python:`
configuration section. The second instance loads the second script,
and so on.

When there are more module instances in the module list than there are
scripts in the `python:` section, an error is raised during
initialization and unbound won't start. When more scripts than module
instances are provided, the surplus scripts are ignored.

@episource episource force-pushed the episource:dev/pythonmod-multi-instance/master branch from 42b84d9 to bfae298 Mar 2, 2019

@bleve bleve referenced this pull request Jun 6, 2019

@wcawijngaards wcawijngaards merged commit bfae298 into NLnetLabs:master Jun 18, 2019

wcawijngaards added a commit that referenced this pull request Jun 18, 2019
Merge branch 'episource-dev/all-merged/master'.
Merge PR #6: Python module: support multiple instances
Merge PR #5: Python module: define constant MODULE_RESTART_NEXT
Merge PR #4: Python module: assign something useful to the per-query data store 'qdata'
wcawijngaards added a commit that referenced this pull request Jun 18, 2019
- Merge PR #6: Python module: support multiple instances
- Merge PR #5: Python module: define constant MODULE_RESTART_NEXT
- Merge PR #4: Python module: assign something useful to the
  per-query data store 'qdata'
Noted in Changelog.
@wcawijngaards

This comment has been minimized.

Copy link
Member

commented Jun 18, 2019

Thank you for the python changes. The pull requests did not exist yet when you created them. We moved to github, so we can insert them from here. I merged the all-merged branch as you suggested.

jedisct1 added a commit to jedisct1/unbound that referenced this pull request Jun 29, 2019
Merge remote-tracking branch 'nlnet/master'
* nlnet/master: (22 commits)
  Nicer spelling and layout.
  - For NLnetLabs#45, check that 127.0.0.1 and ::1 are not used in unbound.conf   when do-not-query-localhost is turned on, or at default on,   unbound-checkconf prints a warning if it is found in forward-addr or   stub-addr statements.
  - Fix memleak in unit test, reported from the clang 8.0 static analyzer.
  - Fix python dict reference and double free in config.
  - Merge PR NLnetLabs#6: Python module: support multiple instances - Merge PR NLnetLabs#5: Python module: define constant MODULE_RESTART_NEXT - Merge PR NLnetLabs#4: Python module: assign something useful to the   per-query data store 'qdata' Noted in Changelog.
  - Added documentation to the ipset files (for doxygen output).
  - make depend
  - Fix to make unbound-control with ipset, remove unused variable,   use unsigned type because of comparison, and assign null instead   of compare with it.  Remade lex and yacc output.
  - PR NLnetLabs#28: IPSet module, by Kevin Chou.  Created a module to support   the ipset that could add the domain's ip to a list easily.   Needs libmnl, and --enable-ipset and config it, doc/README.ipset.md. - Fix to omit RRSIGs from addition to the ipset.
  - Fix for NLnetLabs#24: Fix abort due to scan of auth zone masters using old   address from previous scan.
  - Fix NLnetLabs#39: In libunbound, leftover logfile is close()d unpredictably.
  - Master contains version 1.9.3 in development.
  fix segmentation fault
  rollback the code
  bugfix
  performance improvement
  edit config parser to support ipset
  Add support for ipset
  Document how to configure multiple python modules
  Support multiple python module instances
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.