feature: support socket in some block phase#1825
Open
rainingmaster wants to merge 9 commits intoopenresty:masterfrom
Open
feature: support socket in some block phase#1825rainingmaster wants to merge 9 commits intoopenresty:masterfrom
rainingmaster wants to merge 9 commits intoopenresty:masterfrom
Conversation
cf8a31d to
d171684
Compare
d171684 to
64c3805
Compare
7b2ce35 to
ee498c3
Compare
deba12
reviewed
Nov 18, 2020
972f3d4 to
f083783
Compare
836cadf to
96f98b8
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", |
Contributor
There was a problem hiding this comment.
Suggested change
| "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, |
Contributor
There was a problem hiding this comment.
Suggested change
| 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, |
Contributor
There was a problem hiding this comment.
Suggested change
| 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, |
Contributor
There was a problem hiding this comment.
Suggested change
| 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, |
Comment on lines
+24
to
+26
| 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; |
Contributor
There was a problem hiding this comment.
Suggested change
| 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 |
| ngx_http_lua_assert(lmcf->lua != NULL); | ||
|
|
||
| if (!lmcf->requires_shm && lmcf->init_handler) { | ||
| cycle = cf->cycle; |
Contributor
There was a problem hiding this comment.
we should move all these codes into init_handler
| | NGX_HTTP_LUA_CONTEXT_SSL_SESS_FETCH) | ||
|
|
||
| #define NGX_HTTP_LUA_CONTEXT_BLOCKED_COSOCKET \ | ||
| (NGX_HTTP_LUA_CONTEXT_INIT \ |
|
|
||
|
|
||
|
|
||
| === TEST 73: run in init_worker_by_lua |
Contributor
There was a problem hiding this comment.
Suggested change
| === TEST 73: run in init_worker_by_lua | |
| === TEST 73: run in init_by_lua |
| \z | ||
| [error] | ||
| --- timeout: 5 | ||
| --- ONLY |
Contributor
There was a problem hiding this comment.
Suggested change
| --- ONLY | |
| --- ONLY |
Suggested change
| --- 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 :( |
|
This pull request is now in conflict :( |
|
This pull request is now in conflict :( |
|
This pull request is now in conflict :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_luato 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.