comparison src/os/unix/ngx_process.c @ 650:4d05413aebad NGINX_1_1_9

nginx 1.1.9 *) Change: now double quotes are encoded in an "echo" SSI-command output. Thanks to Zaur Abasmirzoev. *) Feature: the "valid" parameter of the "resolver" directive. By default TTL returned by a DNS server is used. Thanks to Kirill A. Korinskiy. *) Bugfix: nginx might hang after a worker process abnormal termination. *) Bugfix: a segmentation fault might occur in a worker process if SNI was used; the bug had appeared in 1.1.2. *) Bugfix: in the "keepalive_disable" directive; the bug had appeared in 1.1.8. Thanks to Alexander Usov. *) Bugfix: SIGWINCH signal did not work after first binary upgrade; the bug had appeared in 1.1.1. *) Bugfix: backend responses with length not matching "Content-Length" header line are no longer cached. *) Bugfix: in the "scgi_param" directive, if complex parameters were used. *) Bugfix: in the "epoll" event method. Thanks to Yichun Zhang. *) Bugfix: in the ngx_http_flv_module. Thanks to Piotr Sikora. *) Bugfix: in the ngx_http_mp4_module. *) Bugfix: IPv6 addresses are now handled properly in a request line and in a "Host" request header line. *) Bugfix: "add_header" and "expires" directives did not work if a request was proxied and response status code was 206. *) Bugfix: nginx could not be built on FreeBSD 10. *) Bugfix: nginx could not be built on AIX.
author Igor Sysoev <http://sysoev.ru>
date Mon, 28 Nov 2011 00:00:00 +0400
parents eb208e0cf44d
children d0f7a625f27c
comparison
equal deleted inserted replaced
649:c5b99ec117cd 650:4d05413aebad
20 20
21 21
22 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data); 22 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data);
23 static void ngx_signal_handler(int signo); 23 static void ngx_signal_handler(int signo);
24 static void ngx_process_get_status(void); 24 static void ngx_process_get_status(void);
25 static void ngx_unlock_mutexes(ngx_pid_t pid);
25 26
26 27
27 int ngx_argc; 28 int ngx_argc;
28 char **ngx_argv; 29 char **ngx_argv;
29 char **ngx_os_argv; 30 char **ngx_os_argv;
492 #endif 493 #endif
493 494
494 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err, 495 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err,
495 "waitpid() failed"); 496 "waitpid() failed");
496 return; 497 return;
497 }
498
499
500 if (ngx_accept_mutex_ptr) {
501
502 /*
503 * unlock the accept mutex if the abnormally exited process
504 * held it
505 */
506
507 ngx_atomic_cmp_set(ngx_accept_mutex_ptr, pid, 0);
508 } 498 }
509 499
510 500
511 one = 1; 501 one = 1;
512 process = "unknown process"; 502 process = "unknown process";
543 "%s %P exited with fatal code %d " 533 "%s %P exited with fatal code %d "
544 "and cannot be respawned", 534 "and cannot be respawned",
545 process, pid, WEXITSTATUS(status)); 535 process, pid, WEXITSTATUS(status));
546 ngx_processes[i].respawn = 0; 536 ngx_processes[i].respawn = 0;
547 } 537 }
538
539 ngx_unlock_mutexes(pid);
540 }
541 }
542
543
544 static void
545 ngx_unlock_mutexes(ngx_pid_t pid)
546 {
547 ngx_uint_t i;
548 ngx_shm_zone_t *shm_zone;
549 ngx_list_part_t *part;
550 ngx_slab_pool_t *sp;
551
552 /*
553 * unlock the accept mutex if the abnormally exited process
554 * held it
555 */
556
557 if (ngx_accept_mutex_ptr) {
558 (void) ngx_shmtx_force_unlock(&ngx_accept_mutex, pid);
559 }
560
561 /*
562 * unlock shared memory mutexes if held by the abnormally exited
563 * process
564 */
565
566 part = (ngx_list_part_t *) &ngx_cycle->shared_memory.part;
567 shm_zone = part->elts;
568
569 for (i = 0; /* void */ ; i++) {
570
571 if (i >= part->nelts) {
572 if (part->next == NULL) {
573 break;
574 }
575 part = part->next;
576 shm_zone = part->elts;
577 i = 0;
578 }
579
580 sp = (ngx_slab_pool_t *) shm_zone[i].shm.addr;
581
582 if (ngx_shmtx_force_unlock(&sp->mutex, pid)) {
583 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
584 "shared memory zone \"%V\" was locked by %P",
585 &shm_zone[i].shm.name, pid);
586 }
548 } 587 }
549 } 588 }
550 589
551 590
552 void 591 void