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

fix(core): set worker ID of privileged agent to -1 #12385

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

outsinre
Copy link
Contributor

@outsinre outsinre commented Jan 22, 2024

Summary

By default, ngx.worker.id() returns nil for the privileged agent. Now Fall back to -1 as the worker ID of privileged agent worker to avoid error. Keep consistent with code like

id = ngx.worker.id() or -1

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #FTI-5707

Copy link
Contributor

@ms2008 ms2008 left a comment

Choose a reason for hiding this comment

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

There are still several things that haven't been changed, like here

local worker_id = ngx_worker_id()

Please find out where all the calls are made with the keyword worker_id.

@outsinre
Copy link
Contributor Author

outsinre commented Jan 22, 2024

ngx_worker_id

Done.

By default, `ngx.worker.id()` returns `nil` for the privileged agent.
Now consistently set it to `-1`.
@outsinre outsinre force-pushed the privileged-agent-id-1 branch from a1ecaee to 8f5c13a Compare January 22, 2024 08:16
@outsinre outsinre changed the title fix(*): set worker ID of privileged agent to -1 fix(core): set worker ID of privileged agent to -1 Jan 22, 2024
@ms2008 ms2008 merged commit d142390 into master Feb 5, 2024
23 checks passed
@ms2008 ms2008 deleted the privileged-agent-id-1 branch February 5, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants