HelloBug0 opened a new issue #3229:
URL: https://github.com/apache/apisix/issues/3229


   ### Issue description
   When I study the code of APISIX, I'm not quite clear self.running in file 
apisix/core/config_etcd.lua 
[here](https://github.com/apache/apisix/blob/14ebb590a785771fc5b077ad983838d72ae7e936/apisix/core/config_etcd.lua#L527).
   I will be so appreciated if you could help me understand these 
questions.:smiley:
   
   1. I searched self.running in the whole project, and there is one function 
named 
[_M.close](https://github.com/apache/apisix/blob/14ebb590a785771fc5b077ad983838d72ae7e936/apisix/core/config_etcd.lua#L606)
 that set this variable to false and one function named 
[_M.new](https://github.com/apache/apisix/blob/14ebb590a785771fc5b077ad983838d72ae7e936/apisix/core/config_etcd.lua#L643)
 that set this variable to true.  I didn't see anywhere where call _M.close. So 
here is the question, what's the purpose of this variable?
   2. Why do we use cycle 
[here](https://github.com/apache/apisix/blob/14ebb590a785771fc5b077ad983838d72ae7e936/apisix/core/config_etcd.lua#L527)
 if we will call the function again 
[here](https://github.com/apache/apisix/blob/14ebb590a785771fc5b077ad983838d72ae7e936/apisix/core/config_etcd.lua#L573)
 after the cycle?
   3. If we have a strong reason to use cycle, why is the cycle times 32(`i <= 
32`)
   
   ### Environment
   
   + apisix version (master):
   + OS: (Linux VM-0-7-centos 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 
17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux)
   + OpenResty version: (nginx version: openresty/1.19.3.1
   built by gcc 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
   built with OpenSSL 1.1.1h 22 Sep 2020
   TLS SNI support enabled
   configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 
-DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include 
-I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' 
--add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 
--add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 
--add-module=../set-misc-nginx-module-0.32 
--add-module=../form-input-nginx-module-0.12 
--add-module=../encrypted-session-nginx-module-0.08 
--add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.19 
--add-module=../ngx_lua_upstream-0.07 
--add-module=../headers-more-nginx-module-0.33 
--add-module=../array-var-nginx-module-0.05 
--add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 
--add-module=../redis-nginx-module-0.3.7 --add-module=../ngx_stream_lua-0.0.9 
--with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib 
-L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/loca
 l/openresty/openssl111/lib 
-Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib'
 --with-cc='ccache gcc -fdiagnostics-color=always' --with-pcre-jit 
--with-stream --with-stream_ssl_module --with-stream_ssl_preread_module 
--with-http_v2_module --without-mail_pop3_module --without-mail_imap_module 
--without-mail_smtp_module --with-http_stub_status_module 
--with-http_realip_module --with-http_addition_module 
--with-http_auth_request_module --with-http_secure_link_module 
--with-http_random_index_module --with-http_gzip_static_module 
--with-http_sub_module --with-http_dav_module --with-http_flv_module 
--with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat 
--with-stream --with-http_ssl_module)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to