comparison src/http/ngx_http_upstream.c @ 6794:93b294c5d581

Upstream: avoid holding a cache node with upgraded connections. Holding a cache node lock doesn't make sense as we can't use caching anyway, and results in "ignore long locked inactive cache entry" alerts if a node is locked for a long time. The same is done for unbuffered connections, as they can be alive for a long time as well.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 03 Nov 2016 17:09:32 +0300
parents 0fba3ed4e7eb
children 1a917932db96
comparison
equal deleted inserted replaced
6793:0fba3ed4e7eb 6794:93b294c5d581
2758 } 2758 }
2759 2759
2760 u->header_sent = 1; 2760 u->header_sent = 1;
2761 2761
2762 if (u->upgrade) { 2762 if (u->upgrade) {
2763
2764 #if (NGX_HTTP_CACHE)
2765
2766 if (r->cache) {
2767 ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
2768 }
2769
2770 #endif
2771
2763 ngx_http_upstream_upgrade(r, u); 2772 ngx_http_upstream_upgrade(r, u);
2764 return; 2773 return;
2765 } 2774 }
2766 2775
2767 c = r->connection; 2776 c = r->connection;
2787 } 2796 }
2788 2797
2789 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 2798 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
2790 2799
2791 if (!u->buffering) { 2800 if (!u->buffering) {
2801
2802 #if (NGX_HTTP_CACHE)
2803
2804 if (r->cache) {
2805 ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
2806 }
2807
2808 #endif
2792 2809
2793 if (u->input_filter == NULL) { 2810 if (u->input_filter == NULL) {
2794 u->input_filter_init = ngx_http_upstream_non_buffered_filter_init; 2811 u->input_filter_init = ngx_http_upstream_non_buffered_filter_init;
2795 u->input_filter = ngx_http_upstream_non_buffered_filter; 2812 u->input_filter = ngx_http_upstream_non_buffered_filter;
2796 u->input_filter_ctx = r; 2813 u->input_filter_ctx = r;