passenger 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/Rakefile +1 -1
- data/bin/passenger-install-apache2-module +4 -3
- data/doc/ApplicationPool algorithm.txt +8 -4
- data/doc/Users guide.html +1 -1
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +630 -623
- data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Application_8h-source.html +1 -1
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +2 -2
- data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/Exceptions_8h-source.html +1 -1
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/Logging_8h-source.html +1 -1
- data/doc/cxxapi/MessageChannel_8h-source.html +1 -1
- data/doc/cxxapi/SpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +258 -259
- data/doc/cxxapi/System_8h-source.html +1 -1
- data/doc/cxxapi/Utils_8h-source.html +1 -1
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/classClient-members.html +1 -1
- data/doc/cxxapi/classClient.html +1 -1
- data/doc/cxxapi/classDirectoryMapper-members.html +1 -1
- data/doc/cxxapi/classDirectoryMapper.html +1 -1
- data/doc/cxxapi/classHooks-members.html +1 -1
- data/doc/cxxapi/classHooks.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1BusyException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1TempFile-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1TempFile.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Thread-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Thread.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption-members.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption-members.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption-members.html +1 -1
- data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +1 -1
- data/doc/cxxapi/functions_func.html +1 -1
- data/doc/cxxapi/functions_type.html +1 -1
- data/doc/cxxapi/functions_vars.html +1 -1
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/group__Configuration.html +3 -3
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Exceptions.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/hierarchy.html +1 -1
- data/doc/cxxapi/inherits.html +1 -1
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/cxxapi/namespacePassenger.html +1 -1
- data/doc/cxxapi/namespacePassenger_1_1InterruptableCalls.html +1 -1
- data/doc/cxxapi/namespacemembers.html +1 -1
- data/doc/cxxapi/namespacemembers_func.html +1 -1
- data/doc/cxxapi/namespacemembers_type.html +1 -1
- data/doc/cxxapi/namespaces.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
- data/doc/rdoc/classes/PlatformInfo.html +1 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
- data/doc/rdoc/files/ext/passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/passenger/abstract_request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/application_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/constants_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/dependencies_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/exceptions_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/message_channel_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/utils_rb.html +1 -1
- data/ext/apache2/ApplicationPoolServer.h +7 -0
- data/ext/apache2/ApplicationPoolServerExecutable.cpp +7 -0
- data/ext/apache2/Configuration.h +1 -1
- data/ext/apache2/Hooks.cpp +22 -32
- data/ext/apache2/StandardApplicationPool.h +3 -4
- data/ext/apache2/System.cpp +12 -2
- data/ext/passenger/native_support.c +1 -1
- data/lib/passenger/dependencies.rb +13 -7
- data/lib/passenger/platform_info.rb +1 -1
- data/lib/passenger/railz/application_spawner.rb +9 -1
- metadata +2 -2
@@ -217,7 +217,7 @@
|
|
217
217
|
<a name="l00200"></a>00200
|
218
218
|
<a name="l00201"></a>00201 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_POOL_H_ */</span>
|
219
219
|
</pre></div></div>
|
220
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
220
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
221
221
|
<a href="http://www.doxygen.org/index.html">
|
222
222
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
223
223
|
</body>
|
@@ -441,7 +441,7 @@
|
|
441
441
|
<a name="l00424"></a>00424
|
442
442
|
<a name="l00425"></a>00425 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_H_ */</span>
|
443
443
|
</pre></div></div>
|
444
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
444
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
445
445
|
<a href="http://www.doxygen.org/index.html">
|
446
446
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
447
447
|
</body>
|
@@ -54,7 +54,7 @@
|
|
54
54
|
<a name="l00037"></a>00037 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_BUCKET_H_ */</span>
|
55
55
|
<a name="l00038"></a>00038
|
56
56
|
</pre></div></div>
|
57
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
57
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
58
58
|
<a href="http://www.doxygen.org/index.html">
|
59
59
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
60
60
|
</body>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
<a name="l00031"></a>00031 <span class="comment"> */</span>
|
49
49
|
<a name="l00032"></a>00032 <span class="comment"></span>
|
50
50
|
<a name="l00033"></a>00033 <span class="comment">/** Module version number. */</span>
|
51
|
-
<a name="l00034"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00034</a> <span class="preprocessor">#define PASSENGER_VERSION "2.0.
|
51
|
+
<a name="l00034"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00034</a> <span class="preprocessor">#define PASSENGER_VERSION "2.0.5"</span>
|
52
52
|
<a name="l00035"></a>00035 <span class="preprocessor"></span>
|
53
53
|
<a name="l00036"></a>00036 <span class="preprocessor">#ifdef __cplusplus</span>
|
54
54
|
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor"> #include <set></span>
|
@@ -188,7 +188,7 @@
|
|
188
188
|
<a name="l00171"></a>00171
|
189
189
|
<a name="l00172"></a>00172 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CONFIGURATION_H_ */</span>
|
190
190
|
</pre></div></div>
|
191
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
191
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
192
192
|
<a href="http://www.doxygen.org/index.html">
|
193
193
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
194
194
|
</body>
|
@@ -119,7 +119,7 @@
|
|
119
119
|
<a name="l00102"></a>00102
|
120
120
|
<a name="l00103"></a>00103 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_DUMMY_SPAWN_MANAGER_H_ */</span>
|
121
121
|
</pre></div></div>
|
122
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
122
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
123
123
|
<a href="http://www.doxygen.org/index.html">
|
124
124
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
125
125
|
</body>
|
@@ -237,7 +237,7 @@
|
|
237
237
|
<a name="l00220"></a>00220
|
238
238
|
<a name="l00221"></a>00221 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_EXCEPTIONS_H_ */</span>
|
239
239
|
</pre></div></div>
|
240
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
240
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
241
241
|
<a href="http://www.doxygen.org/index.html">
|
242
242
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
243
243
|
</body>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<a name="l00039"></a>00039 <span class="preprocessor"></span>
|
57
57
|
<a name="l00040"></a>00040 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_HOOKS_H_ */</span>
|
58
58
|
</pre></div></div>
|
59
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
59
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
60
60
|
<a href="http://www.doxygen.org/index.html">
|
61
61
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
62
62
|
</body>
|
@@ -129,7 +129,7 @@
|
|
129
129
|
<a name="l00112"></a>00112 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_LOGGING_H_ */</span>
|
130
130
|
<a name="l00113"></a>00113
|
131
131
|
</pre></div></div>
|
132
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
132
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
133
133
|
<a href="http://www.doxygen.org/index.html">
|
134
134
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
135
135
|
</body>
|
@@ -517,7 +517,7 @@
|
|
517
517
|
<a name="l00500"></a>00500
|
518
518
|
<a name="l00501"></a>00501 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_MESSAGE_CHANNEL_H_ */</span>
|
519
519
|
</pre></div></div>
|
520
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
520
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
521
521
|
<a href="http://www.doxygen.org/index.html">
|
522
522
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
523
523
|
</body>
|
@@ -586,7 +586,7 @@
|
|
586
586
|
<a name="l00569"></a>00569
|
587
587
|
<a name="l00570"></a>00570 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_SPAWN_MANAGER_H_ */</span>
|
588
588
|
</pre></div></div>
|
589
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
589
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
590
590
|
<a href="http://www.doxygen.org/index.html">
|
591
591
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
592
592
|
</body>
|
@@ -466,266 +466,265 @@
|
|
466
466
|
<a name="l00449"></a>00449 activeOrMaxChanged.notify_all();
|
467
467
|
<a name="l00450"></a>00450 }
|
468
468
|
<a name="l00451"></a>00451 } <span class="keywordflow">else</span> {
|
469
|
-
<a name="l00452"></a>00452 <span class="keywordflow">
|
470
|
-
<a name="l00453"></a>00453
|
471
|
-
<a name="l00454"></a>00454
|
472
|
-
<a name="l00455"></a>00455
|
473
|
-
<a name="l00456"></a>00456
|
474
|
-
<a name="l00457"></a>00457
|
475
|
-
<a name="l00458"></a>00458
|
476
|
-
<a name="l00459"></a>00459
|
477
|
-
<a name="l00460"></a>00460
|
478
|
-
<a name="l00461"></a>00461
|
479
|
-
<a name="l00462"></a>00462
|
480
|
-
<a name="l00463"></a>00463
|
481
|
-
<a name="l00464"></a>00464
|
482
|
-
<a name="l00465"></a>00465
|
483
|
-
<a name="l00466"></a>00466 appInstanceCount
|
484
|
-
<a name="l00467"></a>00467 }
|
485
|
-
<a name="l00468"></a>00468
|
486
|
-
<a name="l00469"></a>00469
|
487
|
-
<a name="l00470"></a>00470
|
488
|
-
<a name="l00471"></a>00471
|
489
|
-
<a name="l00472"></a>00472
|
490
|
-
<a name="l00473"></a>00473
|
491
|
-
<a name="l00474"></a>00474
|
492
|
-
<a name="l00475"></a>00475
|
493
|
-
<a name="l00476"></a>00476
|
494
|
-
<a name="l00477"></a>00477
|
495
|
-
<a name="l00478"></a>00478
|
496
|
-
<a name="l00479"></a>00479
|
497
|
-
<a name="l00480"></a>00480
|
498
|
-
<a name="l00481"></a>00481
|
499
|
-
<a name="l00482"></a>00482
|
500
|
-
<a name="l00483"></a>00483
|
501
|
-
<a name="l00484"></a>00484
|
502
|
-
<a name="l00485"></a>00485
|
503
|
-
<a name="l00486"></a>00486
|
504
|
-
<a name="l00487"></a>00487
|
505
|
-
<a name="l00488"></a>00488
|
506
|
-
<a name="l00489"></a>00489
|
507
|
-
<a name="l00490"></a>00490
|
508
|
-
<a name="l00491"></a>00491
|
509
|
-
<a name="l00492"></a>00492
|
510
|
-
<a name="l00493"></a>00493
|
511
|
-
<a name="l00494"></a>00494
|
512
|
-
<a name="l00495"></a>00495
|
513
|
-
<a name="l00496"></a>00496
|
514
|
-
<a name="l00497"></a>00497
|
515
|
-
<a name="l00498"></a>00498 message.append(
|
516
|
-
<a name="l00499"></a>00499
|
517
|
-
<a name="l00500"></a>00500
|
518
|
-
<a name="l00501"></a>00501 <span class="keywordflow">
|
519
|
-
<a name="l00502"></a>00502 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(message
|
520
|
-
<a name="l00503"></a>00503 }
|
521
|
-
<a name="l00504"></a>00504
|
522
|
-
<a name="l00505"></a>00505
|
523
|
-
<a name="l00506"></a>00506
|
524
|
-
<a name="l00507"></a>00507
|
525
|
-
<a name="l00508"></a>00508 message.append(
|
526
|
-
<a name="l00509"></a>00509
|
527
|
-
<a name="l00510"></a>00510
|
528
|
-
<a name="l00511"></a>00511
|
529
|
-
<a name="l00512"></a>00512
|
530
|
-
<a name="l00513"></a>00513
|
531
|
-
<a name="l00514"></a>00514
|
532
|
-
<a name="l00515"></a>00515
|
533
|
-
<a name="l00516"></a>00516
|
534
|
-
<a name="l00517"></a>00517 <span class="
|
535
|
-
<a name="l00518"></a>00518 <span class="comment">
|
536
|
-
<a name="l00519"></a>00519 <span class="comment"> *
|
537
|
-
<a name="l00520"></a>00520 <span class="comment">
|
538
|
-
<a name="l00521"></a>00521 <span class="comment"> *
|
539
|
-
<a name="l00522"></a>00522 <span class="comment"> *
|
540
|
-
<a name="l00523"></a>00523 <span class="comment"> *
|
541
|
-
<a name="l00524"></a>00524 <span class="comment"> * will
|
542
|
-
<a name="l00525"></a>00525 <span class="comment"> *
|
543
|
-
<a name="l00526"></a>00526 <span class="comment"> *
|
544
|
-
<a name="l00527"></a>00527 <span class="comment"> *
|
545
|
-
<a name="l00528"></a>00528 <span class="comment"> *
|
546
|
-
<a name="l00529"></a>00529 <span class="comment"> *
|
547
|
-
<a name="l00530"></a>00530 <span class="comment"> *
|
548
|
-
<a name="l00531"></a>00531 <span class="comment"> *
|
549
|
-
<a name="l00532"></a>00532 <span class="comment"> *
|
550
|
-
<a name="l00533"></a>00533 <span class="comment"> *
|
551
|
-
<a name="l00534"></a>00534 <span class="comment"> * @
|
552
|
-
<a name="l00535"></a>00535 <span class="comment">
|
553
|
-
<a name="l00536"></a>00536
|
554
|
-
<a name="l00537"></a>00537 <span class="
|
555
|
-
<a name="l00538"></a
|
556
|
-
<a name="l00539"></a>00539 <span class="keyword">const</span> <span class="keywordtype">string</span> &
|
557
|
-
<a name="l00540"></a>00540
|
558
|
-
<a name="l00541"></a>00541
|
559
|
-
<a name="l00542"></a>00542
|
560
|
-
<a name="l00543"></a>00543 #
|
561
|
-
<a name="l00544"></a>00544
|
562
|
-
<a name="l00545"></a>00545
|
563
|
-
<a name="l00546"></a>00546 data
|
564
|
-
<a name="l00547"></a>00547
|
565
|
-
<a name="l00548"></a>00548
|
566
|
-
<a name="l00549"></a>00549
|
567
|
-
<a name="l00550"></a>00550
|
568
|
-
<a name="l00551"></a>00551
|
569
|
-
<a name="l00552"></a>00552
|
570
|
-
<a name="l00553"></a>00553
|
571
|
-
<a name="l00554"></a>00554
|
572
|
-
<a name="l00555"></a>00555
|
573
|
-
<a name="l00556"></a>00556
|
574
|
-
<a name="l00557"></a>00557
|
575
|
-
<a name="l00558"></a>00558
|
576
|
-
<a name="l00559"></a>00559
|
577
|
-
<a name="l00560"></a>00560
|
578
|
-
<a name="l00561"></a>00561
|
579
|
-
<a name="l00562"></a>00562
|
580
|
-
<a name="l00563"></a>00563
|
581
|
-
<a name="l00564"></a>00564
|
582
|
-
<a name="l00565"></a>00565
|
583
|
-
<a name="l00566"></a>00566
|
584
|
-
<a name="l00567"></a>00567
|
585
|
-
<a name="l00568"></a>00568
|
586
|
-
<a name="l00569"></a>00569
|
587
|
-
<a name="l00570"></a>00570
|
588
|
-
<a name="l00571"></a>00571
|
589
|
-
<a name="l00572"></a>00572
|
590
|
-
<a name="l00573"></a>00573
|
591
|
-
<a name="l00574"></a>00574
|
592
|
-
<a name="l00575"></a>00575
|
593
|
-
<a name="l00576"></a>00576
|
594
|
-
<a name="l00577"></a>00577
|
595
|
-
<a name="l00578"></a>00578
|
596
|
-
<a name="l00579"></a>00579
|
597
|
-
<a name="l00580"></a>00580
|
598
|
-
<a name="l00581"></a>00581
|
599
|
-
<a name="l00582"></a>00582
|
600
|
-
<a name="l00583"></a>00583
|
601
|
-
<a name="l00584"></a>00584
|
602
|
-
<a name="l00585"></a>00585
|
603
|
-
<a name="l00586"></a
|
604
|
-
<a name="l00587"></a>00587 <span class="keyword">const</span> <span class="keywordtype">string</span> &
|
605
|
-
<a name="l00588"></a>00588 <span class="keywordtype">
|
606
|
-
<a name="l00589"></a>00589 <span class="keyword">const</span> <span class="keywordtype">string</span> &
|
607
|
-
<a name="l00590"></a>00590 <span class="keyword">const</span> <span class="keywordtype">string</span> &
|
608
|
-
<a name="l00591"></a>00591
|
609
|
-
<a name="l00592"></a>00592 <span class="keyword">
|
610
|
-
<a name="l00593"></a>00593
|
611
|
-
<a name="l00594"></a>00594
|
612
|
-
<a name="l00595"></a>00595
|
613
|
-
<a name="l00596"></a>00596
|
614
|
-
<a name="l00597"></a>00597
|
615
|
-
<a name="l00598"></a>00598
|
616
|
-
<a name="l00599"></a>00599
|
617
|
-
<a name="l00600"></a>00600
|
618
|
-
<a name="l00601"></a>00601
|
619
|
-
<a name="l00602"></a>00602
|
620
|
-
<a name="l00603"></a>00603
|
621
|
-
<a name="l00604"></a>00604
|
622
|
-
<a name="l00605"></a>00605 );
|
623
|
-
<a name="l00606"></a>00606
|
624
|
-
<a name="l00607"></a>00607
|
625
|
-
<a name="l00608"></a>00608
|
626
|
-
<a name="l00609"></a>00609
|
627
|
-
<a name="l00610"></a>00610
|
628
|
-
<a name="l00611"></a>00611
|
629
|
-
<a name="l00612"></a>00612
|
630
|
-
<a name="l00613"></a>00613 <span class="
|
631
|
-
<a name="l00614"></a>00614 <span class="keywordflow">
|
632
|
-
<a name="l00615"></a>00615
|
633
|
-
<a name="l00616"></a>00616
|
634
|
-
<a name="l00617"></a>00617
|
635
|
-
<a name="l00618"></a>00618
|
636
|
-
<a name="l00619"></a>00619
|
637
|
-
<a name="l00620"></a>00620
|
638
|
-
<a name="l00621"></a>00621
|
639
|
-
<a name="l00622"></a>00622
|
640
|
-
<a name="l00623"></a>00623
|
641
|
-
<a name="l00624"></a>00624
|
642
|
-
<a name="l00625"></a>00625
|
643
|
-
<a name="l00626"></a>00626 message.append(
|
644
|
-
<a name="l00627"></a>00627 }
|
645
|
-
<a name="l00628"></a>00628
|
646
|
-
<a name="l00629"></a>00629
|
647
|
-
<a name="l00630"></a>00630
|
648
|
-
<a name="l00631"></a>00631
|
649
|
-
<a name="l00632"></a>00632
|
650
|
-
<a name="l00633"></a>00633
|
651
|
-
<a name="l00634"></a>00634
|
652
|
-
<a name="l00635"></a>00635
|
653
|
-
<a name="l00636"></a>00636
|
654
|
-
<a name="l00637"></a>00637
|
655
|
-
<a name="l00638"></a>00638
|
656
|
-
<a name="l00639"></a>00639
|
657
|
-
<a name="l00640"></a>00640
|
658
|
-
<a name="l00641"></a>00641
|
659
|
-
<a name="l00642"></a>00642
|
660
|
-
<a name="l00643"></a>00643
|
661
|
-
<a name="l00644"></a>00644
|
662
|
-
<a name="l00645"></a>00645
|
663
|
-
<a name="l00646"></a>00646
|
664
|
-
<a name="l00647"></a>00647
|
665
|
-
<a name="l00648"></a>00648
|
666
|
-
<a name="l00649"></a
|
667
|
-
<a name="l00650"></a>00650
|
668
|
-
<a name="l00651"></a>00651
|
669
|
-
<a name="l00652"></a>00652
|
670
|
-
<a name="l00653"></a>00653
|
671
|
-
<a name="l00654"></a>00654
|
672
|
-
<a name="l00655"></a>00655
|
673
|
-
<a name="l00656"></a>00656
|
674
|
-
<a name="l00657"></a>00657
|
675
|
-
<a name="l00658"></a>00658
|
676
|
-
<a name="l00659"></a>00659
|
677
|
-
<a name="l00660"></a>00660
|
678
|
-
<a name="l00661"></a>00661
|
679
|
-
<a name="l00662"></a>00662
|
680
|
-
<a name="l00663"></a>00663
|
681
|
-
<a name="l00664"></a>00664
|
682
|
-
<a name="l00665"></a
|
683
|
-
<a name="l00666"></a>00666
|
684
|
-
<a name="l00667"></a>00667
|
685
|
-
<a name="l00668"></a>00668
|
686
|
-
<a name="l00669"></a>00669
|
687
|
-
<a name="l00670"></a>00670
|
688
|
-
<a name="l00671"></a
|
689
|
-
<a name="l00672"></a>00672
|
690
|
-
<a name="l00673"></a>00673
|
691
|
-
<a name="l00674"></a>00674
|
692
|
-
<a name="l00675"></a
|
693
|
-
<a name="l00676"></a>00676
|
694
|
-
<a name="l00677"></a>00677
|
695
|
-
<a name="l00678"></a>00678
|
696
|
-
<a name="l00679"></a
|
697
|
-
<a name="l00680"></a>00680
|
698
|
-
<a name="l00681"></a>00681
|
699
|
-
<a name="l00682"></a>00682
|
700
|
-
<a name="l00683"></a>00683
|
701
|
-
<a name="l00684"></a>00684
|
702
|
-
<a name="l00685"></a
|
703
|
-
<a name="l00686"></a>00686
|
704
|
-
<a name="l00687"></a>00687
|
705
|
-
<a name="l00688"></a>00688
|
706
|
-
<a name="l00689"></a
|
707
|
-
<a name="l00690"></a>00690
|
708
|
-
<a name="l00691"></a>00691
|
709
|
-
<a name="l00692"></a>00692
|
710
|
-
<a name="l00693"></a>00693 <span class="comment">
|
711
|
-
<a name="l00694"></a>00694 <span class="comment"> *
|
712
|
-
<a name="l00695"></a>00695 <span class="comment">
|
713
|
-
<a name="l00696"></a>00696 <span class="
|
714
|
-
<a name="l00697"></a
|
715
|
-
<a name="l00698"></a>00698
|
716
|
-
<a name="l00699"></a>00699
|
717
|
-
<a name="l00700"></a>00700
|
718
|
-
<a name="l00701"></a>00701
|
719
|
-
<a name="l00702"></a>00702
|
720
|
-
<a name="l00703"></a>00703
|
721
|
-
<a name="l00704"></a>00704
|
722
|
-
<a name="l00705"></a>00705
|
723
|
-
<a name="l00706"></a>00706
|
724
|
-
<a name="l00707"></a>00707
|
725
|
-
<a name="l00708"></a>00708
|
726
|
-
<a name="l00709"></a>00709
|
469
|
+
<a name="l00452"></a>00452 <span class="keywordflow">if</span> (active >= max) {
|
470
|
+
<a name="l00453"></a>00453 activeOrMaxChanged.wait(l);
|
471
|
+
<a name="l00454"></a>00454 <span class="keywordflow">goto</span> beginning_of_function;
|
472
|
+
<a name="l00455"></a>00455 }
|
473
|
+
<a name="l00456"></a>00456 <span class="keywordflow">if</span> (count == max) {
|
474
|
+
<a name="l00457"></a>00457 container = inactiveApps.front();
|
475
|
+
<a name="l00458"></a>00458 inactiveApps.pop_front();
|
476
|
+
<a name="l00459"></a>00459 list = apps[container->app->getAppRoot()].get();
|
477
|
+
<a name="l00460"></a>00460 list->erase(container->iterator);
|
478
|
+
<a name="l00461"></a>00461 <span class="keywordflow">if</span> (list->empty()) {
|
479
|
+
<a name="l00462"></a>00462 apps.erase(container->app->getAppRoot());
|
480
|
+
<a name="l00463"></a>00463 restartFileTimes.erase(container->app->getAppRoot());
|
481
|
+
<a name="l00464"></a>00464 appInstanceCount.erase(container->app->getAppRoot());
|
482
|
+
<a name="l00465"></a>00465 } <span class="keywordflow">else</span> {
|
483
|
+
<a name="l00466"></a>00466 appInstanceCount[container->app->getAppRoot()]--;
|
484
|
+
<a name="l00467"></a>00467 }
|
485
|
+
<a name="l00468"></a>00468 count--;
|
486
|
+
<a name="l00469"></a>00469 }
|
487
|
+
<a name="l00470"></a>00470 container = <a class="code" href="group__Support.html#g41b6c4a82fed72531a147de0505a8396" title="Convenience shortcut for creating a shared_ptr.">ptr</a>(<span class="keyword">new</span> AppContainer());
|
488
|
+
<a name="l00471"></a>00471 {
|
489
|
+
<a name="l00472"></a>00472 this_thread::restore_interruption ri(di);
|
490
|
+
<a name="l00473"></a>00473 <a class="code" href="classboost_1_1this__thread_1_1restore__syscall__interruption.html" title="Creating an object of this class on the stack will restore the system call interruption...">this_thread::restore_syscall_interruption</a> rsi(dsi);
|
491
|
+
<a name="l00474"></a>00474 container->app = spawnManager.<a class="code" href="classPassenger_1_1SpawnManager.html#1bafa97204ea49a88b66272be3377d53" title="Spawn a new instance of a Ruby on Rails or Rack application.">spawn</a>(appRoot, lowerPrivilege, lowestUser,
|
492
|
+
<a name="l00475"></a>00475 environment, spawnMethod, appType);
|
493
|
+
<a name="l00476"></a>00476 }
|
494
|
+
<a name="l00477"></a>00477 container->sessions = 0;
|
495
|
+
<a name="l00478"></a>00478 it = apps.find(appRoot);
|
496
|
+
<a name="l00479"></a>00479 <span class="keywordflow">if</span> (it == apps.end()) {
|
497
|
+
<a name="l00480"></a>00480 list = <span class="keyword">new</span> AppContainerList();
|
498
|
+
<a name="l00481"></a>00481 apps[appRoot] = <a class="code" href="group__Support.html#g41b6c4a82fed72531a147de0505a8396" title="Convenience shortcut for creating a shared_ptr.">ptr</a>(list);
|
499
|
+
<a name="l00482"></a>00482 appInstanceCount[appRoot] = 1;
|
500
|
+
<a name="l00483"></a>00483 } <span class="keywordflow">else</span> {
|
501
|
+
<a name="l00484"></a>00484 list = it->second.get();
|
502
|
+
<a name="l00485"></a>00485 appInstanceCount[appRoot]++;
|
503
|
+
<a name="l00486"></a>00486 }
|
504
|
+
<a name="l00487"></a>00487 list->push_back(container);
|
505
|
+
<a name="l00488"></a>00488 container->iterator = list->end();
|
506
|
+
<a name="l00489"></a>00489 container->iterator--;
|
507
|
+
<a name="l00490"></a>00490 count++;
|
508
|
+
<a name="l00491"></a>00491 active++;
|
509
|
+
<a name="l00492"></a>00492 activeOrMaxChanged.notify_all();
|
510
|
+
<a name="l00493"></a>00493 }
|
511
|
+
<a name="l00494"></a>00494 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a> &e) {
|
512
|
+
<a name="l00495"></a>00495 <span class="keywordtype">string</span> message(<span class="stringliteral">"Cannot spawn application '"</span>);
|
513
|
+
<a name="l00496"></a>00496 message.append(appRoot);
|
514
|
+
<a name="l00497"></a>00497 message.append(<span class="stringliteral">"': "</span>);
|
515
|
+
<a name="l00498"></a>00498 message.append(e.<a class="code" href="classPassenger_1_1SpawnException.html#d2da180f89a43423a4b37248249972ff">what</a>());
|
516
|
+
<a name="l00499"></a>00499 <span class="keywordflow">if</span> (e.<a class="code" href="classPassenger_1_1SpawnException.html#e65dc272e183fd9e5637a4091cc6bbf4" title="Check whether an error page is available.">hasErrorPage</a>()) {
|
517
|
+
<a name="l00500"></a>00500 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(message, e.<a class="code" href="classPassenger_1_1SpawnException.html#6f675a37edd7070875d0744e7dd010a1" title="Return the error page content.">getErrorPage</a>());
|
518
|
+
<a name="l00501"></a>00501 } <span class="keywordflow">else</span> {
|
519
|
+
<a name="l00502"></a>00502 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(message);
|
520
|
+
<a name="l00503"></a>00503 }
|
521
|
+
<a name="l00504"></a>00504 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> exception &e) {
|
522
|
+
<a name="l00505"></a>00505 <span class="keywordtype">string</span> message(<span class="stringliteral">"Cannot spawn application '"</span>);
|
523
|
+
<a name="l00506"></a>00506 message.append(appRoot);
|
524
|
+
<a name="l00507"></a>00507 message.append(<span class="stringliteral">"': "</span>);
|
525
|
+
<a name="l00508"></a>00508 message.append(e.what());
|
526
|
+
<a name="l00509"></a>00509 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(message);
|
527
|
+
<a name="l00510"></a>00510 }
|
528
|
+
<a name="l00511"></a>00511
|
529
|
+
<a name="l00512"></a>00512 <span class="keywordflow">return</span> make_pair(container, list);
|
530
|
+
<a name="l00513"></a>00513 }
|
531
|
+
<a name="l00514"></a>00514
|
532
|
+
<a name="l00515"></a>00515 <span class="keyword">public</span>:<span class="comment"></span>
|
533
|
+
<a name="l00516"></a>00516 <span class="comment"> /**</span>
|
534
|
+
<a name="l00517"></a>00517 <span class="comment"> * Create a new StandardApplicationPool object.</span>
|
535
|
+
<a name="l00518"></a>00518 <span class="comment"> *</span>
|
536
|
+
<a name="l00519"></a>00519 <span class="comment"> * @param spawnServerCommand The filename of the spawn server to use.</span>
|
537
|
+
<a name="l00520"></a>00520 <span class="comment"> * @param logFile Specify a log file that the spawn server should use.</span>
|
538
|
+
<a name="l00521"></a>00521 <span class="comment"> * Messages on its standard output and standard error channels</span>
|
539
|
+
<a name="l00522"></a>00522 <span class="comment"> * will be written to this log file. If an empty string is</span>
|
540
|
+
<a name="l00523"></a>00523 <span class="comment"> * specified, no log file will be used, and the spawn server</span>
|
541
|
+
<a name="l00524"></a>00524 <span class="comment"> * will use the same standard output/error channels as the</span>
|
542
|
+
<a name="l00525"></a>00525 <span class="comment"> * current process.</span>
|
543
|
+
<a name="l00526"></a>00526 <span class="comment"> * @param rubyCommand The Ruby interpreter's command.</span>
|
544
|
+
<a name="l00527"></a>00527 <span class="comment"> * @param user The user that the spawn manager should run as. This</span>
|
545
|
+
<a name="l00528"></a>00528 <span class="comment"> * parameter only has effect if the current process is</span>
|
546
|
+
<a name="l00529"></a>00529 <span class="comment"> * running as root. If the empty string is given, or if</span>
|
547
|
+
<a name="l00530"></a>00530 <span class="comment"> * the <tt>user</tt> is not a valid username, then</span>
|
548
|
+
<a name="l00531"></a>00531 <span class="comment"> * the spawn manager will be run as the current user.</span>
|
549
|
+
<a name="l00532"></a>00532 <span class="comment"> * @param rubyCommand The Ruby interpreter's command.</span>
|
550
|
+
<a name="l00533"></a>00533 <span class="comment"> * @throws SystemException An error occured while trying to setup the spawn server.</span>
|
551
|
+
<a name="l00534"></a>00534 <span class="comment"> * @throws IOException The specified log file could not be opened.</span>
|
552
|
+
<a name="l00535"></a>00535 <span class="comment"> */</span>
|
553
|
+
<a name="l00536"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#f175704fc477f37ba1d387be09fa2e6b">00536</a> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#f175704fc477f37ba1d387be09fa2e6b" title="Create a new StandardApplicationPool object.">StandardApplicationPool</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &spawnServerCommand,
|
554
|
+
<a name="l00537"></a>00537 <span class="keyword">const</span> <span class="keywordtype">string</span> &logFile = <span class="stringliteral">""</span>,
|
555
|
+
<a name="l00538"></a>00538 <span class="keyword">const</span> <span class="keywordtype">string</span> &rubyCommand = <span class="stringliteral">"ruby"</span>,
|
556
|
+
<a name="l00539"></a>00539 <span class="keyword">const</span> <span class="keywordtype">string</span> &user = <span class="stringliteral">""</span>)
|
557
|
+
<a name="l00540"></a>00540 :
|
558
|
+
<a name="l00541"></a>00541 #ifndef PASSENGER_USE_DUMMY_SPAWN_MANAGER
|
559
|
+
<a name="l00542"></a>00542 spawnManager(spawnServerCommand, logFile, rubyCommand, user),
|
560
|
+
<a name="l00543"></a>00543 #endif
|
561
|
+
<a name="l00544"></a>00544 data(new SharedData()),
|
562
|
+
<a name="l00545"></a>00545 lock(data->lock),
|
563
|
+
<a name="l00546"></a>00546 activeOrMaxChanged(data->activeOrMaxChanged),
|
564
|
+
<a name="l00547"></a>00547 apps(data->apps),
|
565
|
+
<a name="l00548"></a>00548 max(data->max),
|
566
|
+
<a name="l00549"></a>00549 count(data->count),
|
567
|
+
<a name="l00550"></a>00550 active(data->active),
|
568
|
+
<a name="l00551"></a>00551 maxPerApp(data->maxPerApp),
|
569
|
+
<a name="l00552"></a>00552 inactiveApps(data->inactiveApps),
|
570
|
+
<a name="l00553"></a>00553 restartFileTimes(data->restartFileTimes),
|
571
|
+
<a name="l00554"></a>00554 appInstanceCount(data->appInstanceCount)
|
572
|
+
<a name="l00555"></a>00555 {
|
573
|
+
<a name="l00556"></a>00556 detached = <span class="keyword">false</span>;
|
574
|
+
<a name="l00557"></a>00557 done = <span class="keyword">false</span>;
|
575
|
+
<a name="l00558"></a>00558 max = DEFAULT_MAX_POOL_SIZE;
|
576
|
+
<a name="l00559"></a>00559 count = 0;
|
577
|
+
<a name="l00560"></a>00560 active = 0;
|
578
|
+
<a name="l00561"></a>00561 useGlobalQueue = <span class="keyword">false</span>;
|
579
|
+
<a name="l00562"></a>00562 waitingOnGlobalQueue = 0;
|
580
|
+
<a name="l00563"></a>00563 maxPerApp = DEFAULT_MAX_INSTANCES_PER_APP;
|
581
|
+
<a name="l00564"></a>00564 maxIdleTime = DEFAULT_MAX_IDLE_TIME;
|
582
|
+
<a name="l00565"></a>00565 cleanerThread = <span class="keyword">new</span> thread(
|
583
|
+
<a name="l00566"></a>00566 bind(&StandardApplicationPool::cleanerThreadMainLoop, <span class="keyword">this</span>),
|
584
|
+
<a name="l00567"></a>00567 CLEANER_THREAD_STACK_SIZE
|
585
|
+
<a name="l00568"></a>00568 );
|
586
|
+
<a name="l00569"></a>00569 }
|
587
|
+
<a name="l00570"></a>00570
|
588
|
+
<a name="l00571"></a>00571 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1StandardApplicationPool.html" title="A standard implementation of ApplicationPool for single-process environments.">StandardApplicationPool</a>() {
|
589
|
+
<a name="l00572"></a>00572 <span class="keywordflow">if</span> (!detached) {
|
590
|
+
<a name="l00573"></a>00573 this_thread::disable_interruption di;
|
591
|
+
<a name="l00574"></a>00574 {
|
592
|
+
<a name="l00575"></a>00575 mutex::scoped_lock l(lock);
|
593
|
+
<a name="l00576"></a>00576 done = <span class="keyword">true</span>;
|
594
|
+
<a name="l00577"></a>00577 cleanerThreadSleeper.notify_one();
|
595
|
+
<a name="l00578"></a>00578 }
|
596
|
+
<a name="l00579"></a>00579 cleanerThread->join();
|
597
|
+
<a name="l00580"></a>00580 }
|
598
|
+
<a name="l00581"></a>00581 <span class="keyword">delete</span> cleanerThread;
|
599
|
+
<a name="l00582"></a>00582 }
|
600
|
+
<a name="l00583"></a>00583
|
601
|
+
<a name="l00584"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#0dcdd88c39d7f1a1d667e24c3cb9b243">00584</a> <span class="keyword">virtual</span> <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a> <span class="keyword">get</span>(
|
602
|
+
<a name="l00585"></a>00585 <span class="keyword">const</span> <span class="keywordtype">string</span> &appRoot,
|
603
|
+
<a name="l00586"></a>00586 <span class="keywordtype">bool</span> lowerPrivilege = <span class="keyword">true</span>,
|
604
|
+
<a name="l00587"></a>00587 <span class="keyword">const</span> <span class="keywordtype">string</span> &lowestUser = <span class="stringliteral">"nobody"</span>,
|
605
|
+
<a name="l00588"></a>00588 <span class="keyword">const</span> <span class="keywordtype">string</span> &environment = <span class="stringliteral">"production"</span>,
|
606
|
+
<a name="l00589"></a>00589 <span class="keyword">const</span> <span class="keywordtype">string</span> &spawnMethod = <span class="stringliteral">"smart"</span>,
|
607
|
+
<a name="l00590"></a>00590 <span class="keyword">const</span> <span class="keywordtype">string</span> &appType = <span class="stringliteral">"rails"</span>
|
608
|
+
<a name="l00591"></a>00591 ) {
|
609
|
+
<a name="l00592"></a>00592 <span class="keyword">using namespace </span>boost::posix_time;
|
610
|
+
<a name="l00593"></a>00593 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> attempt = 0;
|
611
|
+
<a name="l00594"></a>00594 ptime timeLimit(get_system_time() + millisec(GET_TIMEOUT));
|
612
|
+
<a name="l00595"></a>00595 unique_lock<mutex> l(lock);
|
613
|
+
<a name="l00596"></a>00596
|
614
|
+
<a name="l00597"></a>00597 <span class="keywordflow">while</span> (<span class="keyword">true</span>) {
|
615
|
+
<a name="l00598"></a>00598 attempt++;
|
616
|
+
<a name="l00599"></a>00599
|
617
|
+
<a name="l00600"></a>00600 pair<AppContainerPtr, AppContainerList *> p(
|
618
|
+
<a name="l00601"></a>00601 spawnOrUseExisting(l, appRoot, lowerPrivilege, lowestUser,
|
619
|
+
<a name="l00602"></a>00602 environment, spawnMethod, appType)
|
620
|
+
<a name="l00603"></a>00603 );
|
621
|
+
<a name="l00604"></a>00604 AppContainerPtr &container(p.first);
|
622
|
+
<a name="l00605"></a>00605 AppContainerList &list(*p.second);
|
623
|
+
<a name="l00606"></a>00606
|
624
|
+
<a name="l00607"></a>00607 container->lastUsed = time(NULL);
|
625
|
+
<a name="l00608"></a>00608 container->sessions++;
|
626
|
+
<a name="l00609"></a>00609
|
627
|
+
<a name="l00610"></a>00610 P_ASSERT(verifyState(), <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a>(),
|
628
|
+
<a name="l00611"></a>00611 <span class="stringliteral">"State is valid:\n"</span> << <a class="code" href="group__Support.html#gf6fab368d70c18fdf16bf5a24f630407" title="Convert anything to a string.">toString</a>(<span class="keyword">false</span>));
|
629
|
+
<a name="l00612"></a>00612 <span class="keywordflow">try</span> {
|
630
|
+
<a name="l00613"></a>00613 <span class="keywordflow">return</span> container->app->connect(SessionCloseCallback(data, container));
|
631
|
+
<a name="l00614"></a>00614 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> exception &e) {
|
632
|
+
<a name="l00615"></a>00615 container->sessions--;
|
633
|
+
<a name="l00616"></a>00616 <span class="keywordflow">if</span> (attempt == MAX_GET_ATTEMPTS) {
|
634
|
+
<a name="l00617"></a>00617 <span class="keywordtype">string</span> message(<span class="stringliteral">"Cannot connect to an existing "</span>
|
635
|
+
<a name="l00618"></a>00618 <span class="stringliteral">"application instance for '"</span>);
|
636
|
+
<a name="l00619"></a>00619 message.append(appRoot);
|
637
|
+
<a name="l00620"></a>00620 message.append(<span class="stringliteral">"': "</span>);
|
638
|
+
<a name="l00621"></a>00621 <span class="keywordflow">try</span> {
|
639
|
+
<a name="l00622"></a>00622 <span class="keyword">const</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a> &syse =
|
640
|
+
<a name="l00623"></a>00623 <span class="keyword">dynamic_cast<</span><span class="keyword">const </span><a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a> &<span class="keyword">></span>(e);
|
641
|
+
<a name="l00624"></a>00624 message.append(syse.<a class="code" href="classPassenger_1_1SystemException.html#0ef41d755fea2c9b1db2252e7c418dc8" title="Returns the system&#39;s error message.">sys</a>());
|
642
|
+
<a name="l00625"></a>00625 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> bad_cast &) {
|
643
|
+
<a name="l00626"></a>00626 message.append(e.what());
|
644
|
+
<a name="l00627"></a>00627 }
|
645
|
+
<a name="l00628"></a>00628 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>(message);
|
646
|
+
<a name="l00629"></a>00629 } <span class="keywordflow">else</span> {
|
647
|
+
<a name="l00630"></a>00630 list.erase(container->iterator);
|
648
|
+
<a name="l00631"></a>00631 <span class="keywordflow">if</span> (list.empty()) {
|
649
|
+
<a name="l00632"></a>00632 apps.erase(appRoot);
|
650
|
+
<a name="l00633"></a>00633 appInstanceCount.erase(appRoot);
|
651
|
+
<a name="l00634"></a>00634 }
|
652
|
+
<a name="l00635"></a>00635 count--;
|
653
|
+
<a name="l00636"></a>00636 active--;
|
654
|
+
<a name="l00637"></a>00637 activeOrMaxChanged.notify_all();
|
655
|
+
<a name="l00638"></a>00638 P_ASSERT(verifyState(), <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a>(),
|
656
|
+
<a name="l00639"></a>00639 <span class="stringliteral">"State is valid."</span>);
|
657
|
+
<a name="l00640"></a>00640 }
|
658
|
+
<a name="l00641"></a>00641 }
|
659
|
+
<a name="l00642"></a>00642 }
|
660
|
+
<a name="l00643"></a>00643 <span class="comment">// Never reached; shut up compiler warning</span>
|
661
|
+
<a name="l00644"></a>00644 <span class="keywordflow">return</span> <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a>();
|
662
|
+
<a name="l00645"></a>00645 }
|
663
|
+
<a name="l00646"></a>00646
|
664
|
+
<a name="l00647"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#bcf8faeb4f431ae07ea0e20270661d08">00647</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#bcf8faeb4f431ae07ea0e20270661d08" title="Clear all application instances that are currently in the pool.">clear</a>() {
|
665
|
+
<a name="l00648"></a>00648 mutex::scoped_lock l(lock);
|
666
|
+
<a name="l00649"></a>00649 apps.clear();
|
667
|
+
<a name="l00650"></a>00650 inactiveApps.clear();
|
668
|
+
<a name="l00651"></a>00651 restartFileTimes.clear();
|
669
|
+
<a name="l00652"></a>00652 appInstanceCount.clear();
|
670
|
+
<a name="l00653"></a>00653 count = 0;
|
671
|
+
<a name="l00654"></a>00654 active = 0;
|
672
|
+
<a name="l00655"></a>00655 activeOrMaxChanged.notify_all();
|
673
|
+
<a name="l00656"></a>00656 }
|
674
|
+
<a name="l00657"></a>00657
|
675
|
+
<a name="l00658"></a>00658 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setMaxIdleTime(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> seconds) {
|
676
|
+
<a name="l00659"></a>00659 mutex::scoped_lock l(lock);
|
677
|
+
<a name="l00660"></a>00660 maxIdleTime = seconds;
|
678
|
+
<a name="l00661"></a>00661 cleanerThreadSleeper.notify_one();
|
679
|
+
<a name="l00662"></a>00662 }
|
680
|
+
<a name="l00663"></a>00663
|
681
|
+
<a name="l00664"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553">00664</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553" title="Set a hard limit on the number of application instances that this ApplicationPool...">setMax</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max) {
|
682
|
+
<a name="l00665"></a>00665 mutex::scoped_lock l(lock);
|
683
|
+
<a name="l00666"></a>00666 this->max = max;
|
684
|
+
<a name="l00667"></a>00667 activeOrMaxChanged.notify_all();
|
685
|
+
<a name="l00668"></a>00668 }
|
686
|
+
<a name="l00669"></a>00669
|
687
|
+
<a name="l00670"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788">00670</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788" title="Get the number of active applications in the pool.">getActive</a>()<span class="keyword"> const </span>{
|
688
|
+
<a name="l00671"></a>00671 <span class="keywordflow">return</span> active;
|
689
|
+
<a name="l00672"></a>00672 }
|
690
|
+
<a name="l00673"></a>00673
|
691
|
+
<a name="l00674"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02">00674</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02" title="Get the number of active applications in the pool.">getCount</a>()<span class="keyword"> const </span>{
|
692
|
+
<a name="l00675"></a>00675 <span class="keywordflow">return</span> count;
|
693
|
+
<a name="l00676"></a>00676 }
|
694
|
+
<a name="l00677"></a>00677
|
695
|
+
<a name="l00678"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#3bafcda8d880f70561ad8a9da16e26ef">00678</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#3bafcda8d880f70561ad8a9da16e26ef" title="Set a hard limit on the number of application instances that a single application...">setMaxPerApp</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxPerApp) {
|
696
|
+
<a name="l00679"></a>00679 mutex::scoped_lock l(lock);
|
697
|
+
<a name="l00680"></a>00680 this->maxPerApp = maxPerApp;
|
698
|
+
<a name="l00681"></a>00681 activeOrMaxChanged.notify_all();
|
699
|
+
<a name="l00682"></a>00682 }
|
700
|
+
<a name="l00683"></a>00683
|
701
|
+
<a name="l00684"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#e9c699b56f3a755ab10269c7fe585c2d">00684</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#e9c699b56f3a755ab10269c7fe585c2d" title="Sets whether to use a global queue instead of a per-backend process queue.">setUseGlobalQueue</a>(<span class="keywordtype">bool</span> value) {
|
702
|
+
<a name="l00685"></a>00685 this->useGlobalQueue = value;
|
703
|
+
<a name="l00686"></a>00686 }
|
704
|
+
<a name="l00687"></a>00687
|
705
|
+
<a name="l00688"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#6955152d237920988d20297d2fff5660">00688</a> <span class="keyword">virtual</span> pid_t <a class="code" href="classPassenger_1_1StandardApplicationPool.html#6955152d237920988d20297d2fff5660" title="Get the process ID of the spawn server that is used.">getSpawnServerPid</a>()<span class="keyword"> const </span>{
|
706
|
+
<a name="l00689"></a>00689 <span class="keywordflow">return</span> spawnManager.<a class="code" href="classPassenger_1_1SpawnManager.html#1f77e2e7e6cb464028c13a29f983ad8e" title="Get the Process ID of the spawn server.">getServerPid</a>();
|
707
|
+
<a name="l00690"></a>00690 }
|
708
|
+
<a name="l00691"></a>00691 <span class="comment"></span>
|
709
|
+
<a name="l00692"></a>00692 <span class="comment"> /**</span>
|
710
|
+
<a name="l00693"></a>00693 <span class="comment"> * Returns a textual description of the internal state of</span>
|
711
|
+
<a name="l00694"></a>00694 <span class="comment"> * the application pool.</span>
|
712
|
+
<a name="l00695"></a>00695 <span class="comment"> */</span>
|
713
|
+
<a name="l00696"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#22b4149ca8256c3042fc342e681b0383">00696</a> <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="group__Support.html#gf6fab368d70c18fdf16bf5a24f630407" title="Convert anything to a string.">toString</a>(<span class="keywordtype">bool</span> lockMutex = <span class="keyword">true</span>)<span class="keyword"> const </span>{
|
714
|
+
<a name="l00697"></a>00697 <span class="keywordflow">if</span> (lockMutex) {
|
715
|
+
<a name="l00698"></a>00698 <span class="keywordflow">return</span> <a class="code" href="group__Support.html#gf6fab368d70c18fdf16bf5a24f630407" title="Convert anything to a string.">toString</a>(boost::adopt_lock);
|
716
|
+
<a name="l00699"></a>00699 } <span class="keywordflow">else</span> {
|
717
|
+
<a name="l00700"></a>00700 <span class="keywordflow">return</span> <a class="code" href="group__Support.html#gf6fab368d70c18fdf16bf5a24f630407" title="Convert anything to a string.">toString</a>(boost::defer_lock);
|
718
|
+
<a name="l00701"></a>00701 }
|
719
|
+
<a name="l00702"></a>00702 }
|
720
|
+
<a name="l00703"></a>00703 };
|
721
|
+
<a name="l00704"></a>00704
|
722
|
+
<a name="l00705"></a>00705 } <span class="comment">// namespace Passenger</span>
|
723
|
+
<a name="l00706"></a>00706
|
724
|
+
<a name="l00707"></a>00707 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_STANDARD_APPLICATION_POOL_H_ */</span>
|
725
|
+
<a name="l00708"></a>00708
|
727
726
|
</pre></div></div>
|
728
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
727
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Dec 5 13:53:01 2008 for Passenger by
|
729
728
|
<a href="http://www.doxygen.org/index.html">
|
730
729
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
731
730
|
</body>
|