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

Defaults on queue.lua not working as expected #13729

Open
1 task done
SomnolentKalash opened this issue Oct 4, 2024 · 5 comments
Open
1 task done

Defaults on queue.lua not working as expected #13729

SomnolentKalash opened this issue Oct 4, 2024 · 5 comments
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale

Comments

@SomnolentKalash
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.8.0.0

Current Behavior

Using queue.enqueue with queue config, instead of populating defaults from schema it is asserting the config directly causing queue to fail post concurrency_limit has been added, Need you to populate the defaults first when queue conf is passed in enqueue function

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

No response

@maxipavlovic
Copy link
Contributor

Yep, same here:
kong-auth | 2024/10/07 16:35:21 [error] 241#0: *5153 failed to run log_by_lua*: /usr/local/share/lua/5.1/kong/tools/queue.lua:640: arg #1 (queue_conf) concurrency_limit must be a number kong-auth | stack traceback: kong-auth | [C]: in function 'assert' kong-auth | /usr/local/share/lua/5.1/kong/tools/queue.lua:640: in function 'enqueue' kong-auth | /usr/local/share/lua/5.1/kong/plugins/connect-auth/log.lua:347: in function 'execute' kong-auth | ...ocal/share/lua/5.1/kong/plugins/connect-auth/handler.lua:22: in function <...ocal/share/lua/5.1/kong/plugins/connect-auth/handler.lua:20> kong-auth | /usr/local/share/lua/5.1/kong/init.lua:465: in function 'execute_collected_plugins_iterator' kong-auth | /usr/local/share/lua/5.1/kong/init.lua:1831: in function 'log'

@StarlightIbuki
Copy link
Contributor

IMO it's unclear whether the default value is for plugin configurations or the queue PDK APIs from the changelog. I suppose it's logical also to support the same default value for PDK calls. @vm-001 What do you think?

@vm-001
Copy link
Contributor

vm-001 commented Oct 8, 2024

@SomnolentKalash @maxipavlovic Are you using the queue.lua directly without defining the queue schema in the plugin schema?

Using enqueue directly requires providing all properties. The queue.lua is not yet part of the PDK, and has no backward compatibility guarantee.

The workaround would be

local queue_conf = {
  ...
  concurrency_limit = 1,
}
Queue.enqueue(queue_conf, handler, handler_conf, message)

@ProBrian ProBrian added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Oct 14, 2024
Copy link
Contributor

This issue is marked as stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added stale and removed stale labels Oct 28, 2024
Copy link
Contributor

This issue is marked as stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale
Projects
None yet
Development

No branches or pull requests

6 participants
@maxipavlovic @ProBrian @vm-001 @SomnolentKalash @StarlightIbuki and others