#reload
Posts
-
Digging into nginx's Source 4: Startup and Reading the Config — From main() to ngx_init_cycle
When you start nginx, main() reads the command line, and ngx_init_cycle() reads nginx.conf and builds one complete set of configuration called a cycle — only then does the master process start running. We follow how one parser function handles three cases (a file, a block, and the -g command-line string), how ngx_conf_read_token() splits text into words one character at a time, where the error messages come from, and how reload calls the same ngx_init_cycle() again and inherits listening sockets and shared memory from the old cycle — using the nginx 1.31.9 source and gdb and strace examples.
-
Digging into nginx's Source 6: Master and Workers — Processes, Signals and Zero-Downtime Reload
We follow src/os/unix/ngx_process_cycle.c to see how one nginx -s reload wakes the master's sigsuspend() loop, starts new workers with the new config, and lets the old workers finish what they were doing before they leave. Why the signal handler only sets a flag, the socketpair channel between master and workers, the respawn, just_spawn and exiting bits in the ngx_processes[] table, how a worker killed with kill -9 comes back, and the USR2 binary upgrade — all checked with strace, debug logs and ps.
-
Digging into Tomcat's Source 4: Class Loaders — Each Web App Sees Its Own Classes
Why can two web apps in a single Tomcat process use different classes with the same name? We find the answer in the source — the common, server and shared loaders that Bootstrap builds from catalina.properties, the per-app WebappClassLoaderBase whose loadClass() turns parent delegation around, filter() which picks out exceptions such as jakarta.servlet, the delegate setting, and reloadable reloads with their thread-leak warnings — and check each one on a Tomcat built from the reference commit.