-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feature: support socket in some block phase #1825
base: master
Are you sure you want to change the base?
Conversation
cf8a31d
to
d171684
Compare
d171684
to
64c3805
Compare
7b2ce35
to
ee498c3
Compare
972f3d4
to
f083783
Compare
836cadf
to
96f98b8
Compare
fa55358
to
a109164
Compare
a109164
to
9d3c4ad
Compare
This pull request is now in conflict :( |
|
||
if (revents & (EPOLLERR|EPOLLHUP)) { | ||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, r->connection->log, 0, | ||
"epoll_wait() error on fd:%d ev:%04XD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"epoll_wait() error on fd:%d ev:%04XD", | |
"lua epoll_wait() error on fd:%d ev:%04XD", |
} | ||
|
||
if (events == 0) { | ||
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
if (timer != NGX_TIMER_INFINITE) { | |
return NGX_OK; | |
} | |
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
} | ||
|
||
if (events == 0) { | ||
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
if (timer != NGX_TIMER_INFINITE) { | |
return NGX_OK; | |
} | |
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
} | ||
|
||
if (ready == 0) { | ||
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
if (timer != NGX_TIMER_INFINITE) { | |
return NGX_OK; | |
} | |
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
extern ngx_http_lua_event_actions_t ngx_http_lua_epoll; | ||
extern ngx_http_lua_event_actions_t ngx_http_lua_poll; | ||
extern ngx_http_lua_event_actions_t ngx_http_lua_kqueue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extern ngx_http_lua_event_actions_t ngx_http_lua_epoll; | |
extern ngx_http_lua_event_actions_t ngx_http_lua_poll; | |
extern ngx_http_lua_event_actions_t ngx_http_lua_kqueue; | |
#if (NGX_HAVE_EPOLL) | |
extern ngx_http_lua_event_actions_t ngx_http_lua_epoll; | |
#endif | |
#if (NGX_HAVE_POLL) | |
extern ngx_http_lua_event_actions_t ngx_http_lua_poll; | |
#endif | |
#if (NGX_HAVE_KQUEUE) | |
extern ngx_http_lua_event_actions_t ngx_http_lua_kqueue; | |
#endif |
@@ -890,15 +911,233 @@ ngx_http_lua_init(ngx_conf_t *cf) | |||
ngx_http_lua_assert(lmcf->lua != NULL); | |||
|
|||
if (!lmcf->requires_shm && lmcf->init_handler) { | |||
cycle = cf->cycle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move all these codes into init_handler
@@ -40,6 +40,14 @@ | |||
| NGX_HTTP_LUA_CONTEXT_SSL_CERT \ | |||
| NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH) | |||
|
|||
#define NGX_HTTP_LUA_CONTEXT_BLOCKED_COSOCKET \ | |||
(NGX_HTTP_LUA_CONTEXT_INIT \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need align
|
||
|
||
|
||
=== TEST 73: run in init_worker_by_lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== TEST 73: run in init_worker_by_lua | |
=== TEST 73: run in init_by_lua |
\z | ||
[error] | ||
--- timeout: 5 | ||
--- ONLY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- ONLY | |
--- ONLY |
--- ONLY |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.
Sometime we need use cosocket in
init_by_lua
to get some data from remote before NGINX init.This feature allow us use cosocket in some block phase, and we should limit its use way.