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

feat(protocol): send worker info (id and pid) to broker #54

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

bungle
Copy link
Member

@bungle bungle commented May 21, 2024

Summary

This is a feature that sends worker info to broker. This feature is needed for future PRs to implement worker id based broker queues (to replace worker connection based queues).

Copy link

github-actions bot commented May 21, 2024

Luacheck Report

1 tests   0 ✅  0s ⏱️
1 suites  0 💤
1 files    1 ❌

For more details on these failures, see this check.

Results for commit e649ea0.

♻️ This comment has been updated with latest results.

@bungle bungle force-pushed the feat/send-worker-id-to-broker branch 3 times, most recently from 400ffaa to 6126c0d Compare May 21, 2024 18:11
Copy link
Collaborator

@outsinre outsinre left a comment

Choose a reason for hiding this comment

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

We can postpone this as a standalone job.

@bungle
Copy link
Member Author

bungle commented May 22, 2024

We can postpone this as a standalone job.

What does postponing as a standalone job mean? Do you mean we can cut a release without it? I completely agree. This PR just builds basis for future improvements that I will open ”soon”.

@bungle bungle force-pushed the feat/send-worker-id-to-broker branch from 6126c0d to afb1020 Compare May 22, 2024 12:46
@bungle bungle changed the title feat(protocol): send worker id to broker feat(protocol): send worker info (id and pid) to broker May 22, 2024
@chronolaw chronolaw marked this pull request as draft May 23, 2024 01:37
@chronolaw
Copy link
Collaborator

chronolaw commented May 23, 2024

If it is not urgent, I tend to turn it to draft.

@bungle bungle force-pushed the feat/send-worker-id-to-broker branch from afb1020 to 65b5845 Compare May 28, 2024 12:06
@bungle bungle marked this pull request as ready for review May 28, 2024 12:06
@bungle bungle force-pushed the feat/send-worker-id-to-broker branch 2 times, most recently from 0a9f2bb to 184c5bb Compare May 28, 2024 12:14
@bungle bungle force-pushed the feat/send-worker-id-to-broker branch 3 times, most recently from 1dd8b26 to 8a7141e Compare May 28, 2024 14:02
@chronolaw
Copy link
Collaborator

Question: what is the advantage of replacing connection with worker id? Could I get some explain?

@bungle
Copy link
Member Author

bungle commented May 31, 2024

Question: what is the advantage of replacing connection with worker id? Could I get some explain?

Workers can crash. So this code:

self._clients[worker_connection]:pop()

if it was something like:

QUEUES[worker_id]:pop()

We could make queues survive across worker crashes (and continue writing on them). We could also simplify a lot of loops to just:

for i=1, WORKER_COUNT do
end

I think that with this library we can and probably should assume that each worker connects to a broker.

chronolaw
chronolaw previously approved these changes Jun 3, 2024
@chronolaw chronolaw requested a review from outsinre June 3, 2024 06:23
outsinre
outsinre previously approved these changes Jun 6, 2024
@bungle bungle dismissed stale reviews from outsinre and chronolaw via 62bf45c June 6, 2024 07:57
@bungle bungle force-pushed the feat/send-worker-id-to-broker branch from 8a7141e to 62bf45c Compare June 6, 2024 07:57
tzssangglass
tzssangglass previously approved these changes Jun 13, 2024
Copy link
Member

@tzssangglass tzssangglass left a comment

Choose a reason for hiding this comment

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

LGTM

@bungle bungle force-pushed the feat/send-worker-id-to-broker branch from 62bf45c to f7df382 Compare June 18, 2024 15:45
### Summary

This is a feature that sends worker info to broker. This feature is needed
for future PRs to implement worker id based broker queues (to replace
worker connection based queues).
@bungle bungle force-pushed the feat/send-worker-id-to-broker branch from f7df382 to e649ea0 Compare June 18, 2024 17:59
@gszr gszr requested a review from tzssangglass June 18, 2024 18:03
@gszr gszr merged commit 459f8db into main Jun 18, 2024
13 checks passed
@gszr gszr deleted the feat/send-worker-id-to-broker branch June 18, 2024 18:05
bungle added a commit that referenced this pull request Jun 19, 2024
### Summary

- [style(lib/compat): update module version](#57)
- [tests(*): use resty.events.new correctly as documented](#59)
- [feat(protocol): send worker info (id and pid) to broker](#54)
- [fix(*): option validation of broker id](#62)
- [fix(broker): worker id based queues](#60)
- [chore(worker): actively close connection to broker on error](#63)
- [fix(*): retain events on send failures](#61)
@bungle bungle mentioned this pull request Jun 19, 2024
bungle added a commit that referenced this pull request Jun 19, 2024
### Summary

- [style(lib/compat): update module version](#57)
- [tests(*): use resty.events.new correctly as documented](#59)
- [feat(protocol): send worker info (id and pid) to broker](#54)
- [fix(*): option validation of broker id](#62)
- [fix(broker): worker id based queues](#60)
- [chore(worker): actively close connection to broker on error](#63)
- [fix(*): retain events on send failures](#61)
bungle added a commit to Kong/kong that referenced this pull request Jun 19, 2024
### Summary

- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 19, 2024
### Summary

- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 20, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 20, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 21, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 21, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 28, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle added a commit to Kong/kong that referenced this pull request Jun 28, 2024
- [style(lib/compat): update module version](Kong/lua-resty-events#57)
- [tests(*): use resty.events.new correctly as documented](Kong/lua-resty-events#59)
- [feat(protocol): send worker info (id and pid) to broker](Kong/lua-resty-events#54)
- [fix(*): option validation of broker id](Kong/lua-resty-events#62)
- [fix(broker): worker id based queues](Kong/lua-resty-events#60)
- [chore(worker): actively close connection to broker on error](Kong/lua-resty-events#63)
- [fix(*): retain events on send failures](Kong/lua-resty-events#61)

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
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.

5 participants