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): disable C assert in upstream keepalive patch #10212

Merged
merged 3 commits into from
Feb 3, 2023

Conversation

chronolaw
Copy link
Contributor

@chronolaw chronolaw commented Feb 2, 2023

Summary

See: KAG-474

Core code:

upool = lua_newuserdata(L, size); /* pools upool */

items = (ngx_http_lua_balancer_keepalive_item_t *) (&upool->free + 1);

ngx_http_lua_assert((void *) items == ngx_align_ptr(items, NGX_ALIGNMENT));

items points to the memory that allocated by LuaJIT (lua_newuserdata),
so it may not fit the Nginx's alignment requirement.

Checklist

@chronolaw chronolaw changed the title fix(core): disable C assert in balancer fix(core): disable C assert in balancer patch Feb 2, 2023
@chronolaw chronolaw changed the title fix(core): disable C assert in balancer patch fix(core): disable C assert in upstream keepalive patch Feb 2, 2023
@@ -673,7 +673,7 @@ index f71a3e00..0d403716 100644
+
+ items = (ngx_http_lua_balancer_keepalive_item_t *) (&upool->free + 1);
+
+ ngx_http_lua_assert((void *) items == ngx_align_ptr(items, NGX_ALIGNMENT));
+ /*ngx_http_lua_assert((void *) items == ngx_align_ptr(items, NGX_ALIGNMENT));*/
Copy link
Member

Choose a reason for hiding this comment

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

We should remove this unneeded code, instead of commenting it out. It is a good habit to have.

@dndx dndx merged commit f8ac189 into master Feb 3, 2023
@dndx dndx deleted the fix/remove_unnecessary_cland_assert branch February 3, 2023 07:27
chronolaw added a commit that referenced this pull request Feb 3, 2023
dndx pushed a commit that referenced this pull request Feb 6, 2023
This was referenced Mar 16, 2023
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.

2 participants