passenger 2.0.3 → 2.0.4
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 +8 -5
- data/bin/passenger-install-apache2-module +6 -1
- data/doc/ApplicationPool algorithm.txt +23 -5
- data/doc/Architectural overview.html +778 -0
- data/doc/Security of user switching support.html +1 -1
- data/doc/Users guide.html +113 -31
- data/doc/Users guide.txt +104 -10
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +683 -0
- data/doc/cxxapi/ApplicationPool_8h-source.html +224 -0
- data/doc/cxxapi/Application_8h-source.html +448 -0
- data/doc/cxxapi/Bucket_8h-source.html +61 -0
- data/doc/cxxapi/Configuration_8h-source.html +195 -0
- data/doc/cxxapi/DummySpawnManager_8h-source.html +126 -0
- data/doc/cxxapi/Exceptions_8h-source.html +244 -0
- data/doc/cxxapi/Hooks_8h-source.html +63 -0
- data/doc/cxxapi/Logging_8h-source.html +136 -0
- data/doc/cxxapi/MessageChannel_8h-source.html +524 -0
- data/doc/cxxapi/SpawnManager_8h-source.html +593 -0
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +732 -0
- data/doc/cxxapi/System_8h-source.html +251 -0
- data/doc/cxxapi/Utils_8h-source.html +283 -0
- data/doc/cxxapi/annotated.html +59 -0
- data/doc/cxxapi/classClient-members.html +35 -0
- data/doc/cxxapi/classClient.html +117 -0
- data/doc/cxxapi/classDirectoryMapper-members.html +38 -0
- data/doc/cxxapi/classDirectoryMapper.html +203 -0
- data/doc/cxxapi/classHooks-members.html +33 -0
- data/doc/cxxapi/classHooks.html +43 -0
- data/doc/cxxapi/classPassenger_1_1Application-members.html +38 -0
- data/doc/cxxapi/classPassenger_1_1Application.html +229 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +41 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +359 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +225 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +43 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +329 -0
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1BusyException.html +47 -0
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +44 -0
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +51 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +51 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +38 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +61 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1IOException.html +54 -0
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +47 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +591 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +35 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +77 -0
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +255 -0
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +43 -0
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +400 -0
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1SystemException.html +154 -0
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TempFile-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1TempFile.html +128 -0
- data/doc/cxxapi/classPassenger_1_1Thread-members.html +35 -0
- data/doc/cxxapi/classPassenger_1_1Thread.html +100 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption-members.html +33 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption.html +46 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption-members.html +33 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption.html +44 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption-members.html +33 -0
- data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption.html +44 -0
- data/doc/cxxapi/definitions_8h-source.html +28 -0
- data/doc/cxxapi/doxygen.css +433 -0
- data/doc/cxxapi/doxygen.png +0 -0
- data/doc/cxxapi/files.html +42 -0
- data/doc/cxxapi/ftv2blank.png +0 -0
- data/doc/cxxapi/ftv2doc.png +0 -0
- data/doc/cxxapi/ftv2folderclosed.png +0 -0
- data/doc/cxxapi/ftv2folderopen.png +0 -0
- data/doc/cxxapi/ftv2lastnode.png +0 -0
- data/doc/cxxapi/ftv2link.png +0 -0
- data/doc/cxxapi/ftv2mlastnode.png +0 -0
- data/doc/cxxapi/ftv2mnode.png +0 -0
- data/doc/cxxapi/ftv2node.png +0 -0
- data/doc/cxxapi/ftv2plastnode.png +0 -0
- data/doc/cxxapi/ftv2pnode.png +0 -0
- data/doc/cxxapi/ftv2vertline.png +0 -0
- data/doc/cxxapi/functions.html +215 -0
- data/doc/cxxapi/functions_func.html +210 -0
- data/doc/cxxapi/functions_type.html +46 -0
- data/doc/cxxapi/functions_vars.html +48 -0
- data/doc/cxxapi/graph_legend.dot +22 -0
- data/doc/cxxapi/graph_legend.html +87 -0
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +236 -0
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +51 -0
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +43 -0
- data/doc/cxxapi/group__Hooks.html +46 -0
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +406 -0
- data/doc/cxxapi/hierarchy.html +67 -0
- data/doc/cxxapi/index.html +11 -0
- data/doc/cxxapi/inherit__graph__0.map +1 -0
- data/doc/cxxapi/inherit__graph__0.md5 +1 -0
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +1 -0
- data/doc/cxxapi/inherit__graph__1.md5 +1 -0
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -0
- data/doc/cxxapi/inherit__graph__10.md5 +1 -0
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +1 -0
- data/doc/cxxapi/inherit__graph__11.md5 +1 -0
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +1 -0
- data/doc/cxxapi/inherit__graph__12.md5 +1 -0
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +1 -0
- data/doc/cxxapi/inherit__graph__13.md5 +1 -0
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +2 -0
- data/doc/cxxapi/inherit__graph__14.md5 +1 -0
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +1 -0
- data/doc/cxxapi/inherit__graph__15.md5 +1 -0
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +1 -0
- data/doc/cxxapi/inherit__graph__16.md5 +1 -0
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +1 -0
- data/doc/cxxapi/inherit__graph__17.md5 +1 -0
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +1 -0
- data/doc/cxxapi/inherit__graph__18.md5 +1 -0
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +2 -0
- data/doc/cxxapi/inherit__graph__19.md5 +1 -0
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +1 -0
- data/doc/cxxapi/inherit__graph__2.md5 +1 -0
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +1 -0
- data/doc/cxxapi/inherit__graph__20.md5 +1 -0
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +1 -0
- data/doc/cxxapi/inherit__graph__21.md5 +1 -0
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +1 -0
- data/doc/cxxapi/inherit__graph__3.md5 +1 -0
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +1 -0
- data/doc/cxxapi/inherit__graph__4.md5 +1 -0
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +1 -0
- data/doc/cxxapi/inherit__graph__5.md5 +1 -0
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +1 -0
- data/doc/cxxapi/inherit__graph__6.md5 +1 -0
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +1 -0
- data/doc/cxxapi/inherit__graph__7.md5 +1 -0
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +1 -0
- data/doc/cxxapi/inherit__graph__8.md5 +1 -0
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +2 -0
- data/doc/cxxapi/inherit__graph__9.md5 +1 -0
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +102 -0
- data/doc/cxxapi/main.html +27 -0
- data/doc/cxxapi/modules.html +34 -0
- data/doc/cxxapi/namespacePassenger.html +208 -0
- data/doc/cxxapi/namespacePassenger_1_1InterruptableCalls.html +43 -0
- data/doc/cxxapi/namespacemembers.html +70 -0
- data/doc/cxxapi/namespacemembers_func.html +66 -0
- data/doc/cxxapi/namespacemembers_type.html +46 -0
- data/doc/cxxapi/namespaces.html +35 -0
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +33 -0
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +49 -0
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +33 -0
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +49 -0
- data/doc/cxxapi/tab_b.gif +0 -0
- data/doc/cxxapi/tab_l.gif +0 -0
- data/doc/cxxapi/tab_r.gif +0 -0
- data/doc/cxxapi/tabs.css +102 -0
- data/doc/cxxapi/tree.html +167 -0
- data/doc/rdoc/classes/ConditionVariable.html +160 -0
- data/doc/rdoc/classes/Exception.html +120 -0
- data/doc/rdoc/classes/GC.html +113 -0
- data/doc/rdoc/classes/IO.html +150 -0
- data/doc/rdoc/classes/Passenger.html +136 -0
- data/doc/rdoc/classes/Passenger/AbstractRequestHandler.html +402 -0
- data/doc/rdoc/classes/Passenger/AbstractServer.html +649 -0
- data/doc/rdoc/classes/Passenger/AbstractServer/ServerAlreadyStarted.html +97 -0
- data/doc/rdoc/classes/Passenger/AbstractServer/ServerError.html +96 -0
- data/doc/rdoc/classes/Passenger/AbstractServer/ServerNotStarted.html +97 -0
- data/doc/rdoc/classes/Passenger/AbstractServer/UnknownMessage.html +96 -0
- data/doc/rdoc/classes/Passenger/AppInitError.html +137 -0
- data/doc/rdoc/classes/Passenger/Application.html +298 -0
- data/doc/rdoc/classes/Passenger/ConsoleTextTemplate.html +172 -0
- data/doc/rdoc/classes/Passenger/FrameworkInitError.html +143 -0
- data/doc/rdoc/classes/Passenger/HTMLTemplate.html +175 -0
- data/doc/rdoc/classes/Passenger/InitializationError.html +141 -0
- data/doc/rdoc/classes/Passenger/MessageChannel.html +488 -0
- data/doc/rdoc/classes/Passenger/NativeSupport.html +320 -0
- data/doc/rdoc/classes/Passenger/SpawnManager.html +375 -0
- data/doc/rdoc/classes/Passenger/UnknownError.html +125 -0
- data/doc/rdoc/classes/Passenger/Utils.html +578 -0
- data/doc/rdoc/classes/Passenger/VersionNotFound.html +140 -0
- data/doc/rdoc/classes/PlatformInfo.html +302 -0
- data/doc/rdoc/classes/RakeExtensions.html +197 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/DEVELOPERS_TXT.html +230 -0
- data/doc/rdoc/files/README.html +150 -0
- data/doc/rdoc/files/ext/passenger/native_support_c.html +92 -0
- data/doc/rdoc/files/lib/passenger/abstract_request_handler_rb.html +126 -0
- data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +127 -0
- data/doc/rdoc/files/lib/passenger/application_rb.html +123 -0
- data/doc/rdoc/files/lib/passenger/console_text_template_rb.html +122 -0
- data/doc/rdoc/files/lib/passenger/constants_rb.html +114 -0
- data/doc/rdoc/files/lib/passenger/dependencies_rb.html +130 -0
- data/doc/rdoc/files/lib/passenger/exceptions_rb.html +118 -0
- data/doc/rdoc/files/lib/passenger/html_template_rb.html +122 -0
- data/doc/rdoc/files/lib/passenger/message_channel_rb.html +118 -0
- data/doc/rdoc/files/lib/passenger/platform_info_rb.html +122 -0
- data/doc/rdoc/files/lib/passenger/simple_benchmarking_rb.html +118 -0
- data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +139 -0
- data/doc/rdoc/files/lib/passenger/utils_rb.html +130 -0
- data/doc/rdoc/files/lib/rake/extensions_rb.html +122 -0
- data/doc/rdoc/fr_class_index.html +71 -0
- data/doc/rdoc/fr_file_index.html +63 -0
- data/doc/rdoc/fr_method_index.html +120 -0
- data/doc/rdoc/index.html +26 -0
- data/doc/rdoc/rdoc-style.css +187 -0
- data/ext/apache2/ApplicationPool.h +12 -0
- data/ext/apache2/ApplicationPoolServer.h +6 -0
- data/ext/apache2/ApplicationPoolServerExecutable.cpp +6 -0
- data/ext/apache2/Bucket.cpp +63 -69
- data/ext/apache2/Bucket.h +2 -0
- data/ext/apache2/Configuration.cpp +24 -0
- data/ext/apache2/Configuration.h +16 -1
- data/ext/apache2/Hooks.cpp +5 -3
- data/ext/apache2/StandardApplicationPool.h +30 -11
- data/lib/passenger/abstract_request_handler.rb +3 -0
- data/lib/passenger/abstract_server.rb +3 -3
- data/lib/passenger/application.rb +4 -2
- data/lib/passenger/dependencies.rb +10 -1
- data/lib/passenger/platform_info.rb +40 -1
- data/lib/passenger/rack/request_handler.rb +4 -2
- data/lib/passenger/railz/application_spawner.rb +7 -1
- data/lib/passenger/utils.rb +6 -8
- data/lib/rake/gempackagetask.rb +0 -6
- data/lib/rake/rdoctask.rb +84 -23
- data/test/ApplicationPoolTest.cpp +36 -0
- data/test/ruby/rails/minimal_spawner_spec.rb +8 -0
- data/test/ruby/utils_spec.rb +33 -0
- data/test/stub/rails_apps/foobar/config/environments/production.rb +0 -1
- metadata +262 -5
data/ext/apache2/Configuration.h
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
/** Module version number. */
|
34
|
-
#define PASSENGER_VERSION "2.0.
|
34
|
+
#define PASSENGER_VERSION "2.0.4"
|
35
35
|
|
36
36
|
#ifdef __cplusplus
|
37
37
|
#include <set>
|
@@ -112,6 +112,13 @@
|
|
112
112
|
* this server config. */
|
113
113
|
bool poolIdleTimeSpecified;
|
114
114
|
|
115
|
+
/** Whether global queuing should be used. */
|
116
|
+
bool useGlobalQueue;
|
117
|
+
|
118
|
+
/** Whether the useGlobalQueue option was explicitly specified
|
119
|
+
* in this server config. */
|
120
|
+
bool useGlobalQueueSpecified;
|
121
|
+
|
115
122
|
/** Whether user switching support is enabled. */
|
116
123
|
bool userSwitching;
|
117
124
|
|
@@ -123,6 +130,14 @@
|
|
123
130
|
* fails or is disabled. NULL means the option is not specified.
|
124
131
|
*/
|
125
132
|
const char *defaultUser;
|
133
|
+
|
134
|
+
bool getUseGlobalQueue() const {
|
135
|
+
if (useGlobalQueueSpecified) {
|
136
|
+
return useGlobalQueue;
|
137
|
+
} else {
|
138
|
+
return false;
|
139
|
+
}
|
140
|
+
}
|
126
141
|
};
|
127
142
|
}
|
128
143
|
|
data/ext/apache2/Hooks.cpp
CHANGED
@@ -517,7 +517,7 @@ private:
|
|
517
517
|
errno);
|
518
518
|
}
|
519
519
|
written += ret;
|
520
|
-
} while (written < len);
|
520
|
+
} while (written < (size_t) len);
|
521
521
|
}
|
522
522
|
if (len == -1) {
|
523
523
|
throw IOException("An error occurred while receiving HTTP upload data.");
|
@@ -614,6 +614,7 @@ public:
|
|
614
614
|
applicationPool->setMax(config->maxPoolSize);
|
615
615
|
applicationPool->setMaxPerApp(config->maxInstancesPerApp);
|
616
616
|
applicationPool->setMaxIdleTime(config->poolIdleTime);
|
617
|
+
applicationPool->setUseGlobalQueue(config->getUseGlobalQueue());
|
617
618
|
} catch (const thread_interrupted &) {
|
618
619
|
P_TRACE(3, "A system call was interrupted during initialization of "
|
619
620
|
"an Apache child process. Apache is probably restarting or "
|
@@ -700,10 +701,9 @@ public:
|
|
700
701
|
P_TRACE(3, "Forwarding " << r->uri << " to PID " << session->getPid());
|
701
702
|
} catch (const SpawnException &e) {
|
702
703
|
if (e.hasErrorPage()) {
|
704
|
+
r->status = 500;
|
703
705
|
ap_set_content_type(r, "text/html; charset=utf-8");
|
704
706
|
ap_rputs(e.getErrorPage().c_str(), r);
|
705
|
-
// Unfortunately we can't return a 500 Internal Server
|
706
|
-
// Error. Apache's HTTP error handler would kick in.
|
707
707
|
return OK;
|
708
708
|
} else {
|
709
709
|
throw;
|
@@ -860,6 +860,7 @@ destroy_hooks(void *arg) {
|
|
860
860
|
this_thread::disable_syscall_interruption dsi;
|
861
861
|
P_DEBUG("Shutting down Phusion Passenger...");
|
862
862
|
delete hooks;
|
863
|
+
hooks = NULL;
|
863
864
|
} catch (const thread_interrupted &) {
|
864
865
|
// Ignore interruptions, we're shutting down anyway.
|
865
866
|
P_TRACE(3, "A system call was interrupted during shutdown of mod_passenger.");
|
@@ -892,6 +893,7 @@ init_module(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *
|
|
892
893
|
if (hooks != NULL) {
|
893
894
|
P_DEBUG("Restarting Phusion Passenger....");
|
894
895
|
delete hooks;
|
896
|
+
hooks = NULL;
|
895
897
|
}
|
896
898
|
try {
|
897
899
|
hooks = new Hooks(pconf, plog, ptemp, s);
|
@@ -177,7 +177,9 @@ private:
|
|
177
177
|
thread *cleanerThread;
|
178
178
|
bool detached;
|
179
179
|
bool done;
|
180
|
+
bool useGlobalQueue;
|
180
181
|
unsigned int maxIdleTime;
|
182
|
+
unsigned int waitingOnGlobalQueue;
|
181
183
|
condition cleanerThreadSleeper;
|
182
184
|
|
183
185
|
// Shortcuts for instance variables in SharedData. Saves typing in get().
|
@@ -235,6 +237,8 @@ private:
|
|
235
237
|
result << "count = " << count << endl;
|
236
238
|
result << "active = " << active << endl;
|
237
239
|
result << "inactive = " << inactiveApps.size() << endl;
|
240
|
+
result << "Using global queue: " << (useGlobalQueue ? "yes" : "no") << endl;
|
241
|
+
result << "Waiting on global queue: " << waitingOnGlobalQueue << endl;
|
238
242
|
result << endl;
|
239
243
|
|
240
244
|
result << "----------- Applications -----------" << endl;
|
@@ -360,6 +364,8 @@ private:
|
|
360
364
|
const string &spawnMethod,
|
361
365
|
const string &appType
|
362
366
|
) {
|
367
|
+
beginning_of_function:
|
368
|
+
|
363
369
|
this_thread::disable_interruption di;
|
364
370
|
this_thread::disable_syscall_interruption dsi;
|
365
371
|
AppContainerPtr container;
|
@@ -404,19 +410,26 @@ private:
|
|
404
410
|
} else if (count >= max || (
|
405
411
|
maxPerApp != 0 && appInstanceCount[appRoot] >= maxPerApp )
|
406
412
|
) {
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
+
if (useGlobalQueue) {
|
414
|
+
waitingOnGlobalQueue++;
|
415
|
+
activeOrMaxChanged.wait(l);
|
416
|
+
waitingOnGlobalQueue--;
|
417
|
+
goto beginning_of_function;
|
418
|
+
} else {
|
419
|
+
AppContainerList::iterator it(list->begin());
|
420
|
+
AppContainerList::iterator smallest(list->begin());
|
421
|
+
it++;
|
422
|
+
for (; it != list->end(); it++) {
|
423
|
+
if ((*it)->sessions < (*smallest)->sessions) {
|
424
|
+
smallest = it;
|
425
|
+
}
|
413
426
|
}
|
427
|
+
container = *smallest;
|
428
|
+
list->erase(smallest);
|
429
|
+
list->push_back(container);
|
430
|
+
container->iterator = list->end();
|
431
|
+
container->iterator--;
|
414
432
|
}
|
415
|
-
container = *smallest;
|
416
|
-
list->erase(smallest);
|
417
|
-
list->push_back(container);
|
418
|
-
container->iterator = list->end();
|
419
|
-
container->iterator--;
|
420
433
|
} else {
|
421
434
|
container = ptr(new AppContainer());
|
422
435
|
{
|
@@ -547,6 +560,8 @@ public:
|
|
547
560
|
max = DEFAULT_MAX_POOL_SIZE;
|
548
561
|
count = 0;
|
549
562
|
active = 0;
|
563
|
+
useGlobalQueue = false;
|
564
|
+
waitingOnGlobalQueue = 0;
|
550
565
|
maxPerApp = DEFAULT_MAX_INSTANCES_PER_APP;
|
551
566
|
maxIdleTime = DEFAULT_MAX_IDLE_TIME;
|
552
567
|
cleanerThread = new thread(
|
@@ -667,6 +682,10 @@ public:
|
|
667
682
|
activeOrMaxChanged.notify_all();
|
668
683
|
}
|
669
684
|
|
685
|
+
virtual void setUseGlobalQueue(bool value) {
|
686
|
+
this->useGlobalQueue = value;
|
687
|
+
}
|
688
|
+
|
670
689
|
virtual pid_t getSpawnServerPid() const {
|
671
690
|
return spawnManager.getServerPid();
|
672
691
|
}
|
@@ -17,6 +17,7 @@
|
|
17
17
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
18
18
|
|
19
19
|
require 'socket'
|
20
|
+
require 'fcntl'
|
20
21
|
require 'passenger/utils'
|
21
22
|
require 'passenger/native_support'
|
22
23
|
module Passenger
|
@@ -125,6 +126,7 @@ class AbstractRequestHandler
|
|
125
126
|
if !@using_abstract_namespace
|
126
127
|
create_unix_socket_on_filesystem
|
127
128
|
end
|
129
|
+
@socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
128
130
|
@owner_pipe = owner_pipe
|
129
131
|
@previous_signal_handlers = {}
|
130
132
|
end
|
@@ -258,6 +260,7 @@ private
|
|
258
260
|
ios = select([@socket, @owner_pipe])[0]
|
259
261
|
if ios.include?(@socket)
|
260
262
|
client = @socket.accept
|
263
|
+
client.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
261
264
|
|
262
265
|
# The real input stream is not seekable (calling _seek_
|
263
266
|
# or _rewind_ on it will raise an exception). But some
|
@@ -119,12 +119,12 @@ class AbstractServer
|
|
119
119
|
# on a white list of file descriptors. That proved to be way too fragile:
|
120
120
|
# too many file descriptors are being left open even though they shouldn't
|
121
121
|
# be. So now we close file descriptors based on a black list.
|
122
|
-
|
123
|
-
NativeSupport.close_all_file_descriptors(
|
122
|
+
file_descriptors_to_leave_open = [0, 1, 2, @child_socket.fileno]
|
123
|
+
NativeSupport.close_all_file_descriptors(file_descriptors_to_leave_open)
|
124
124
|
# In addition to closing the file descriptors, one must also close
|
125
125
|
# the associated IO objects. This is to prevent IO.close from
|
126
126
|
# double-closing already closed file descriptors.
|
127
|
-
close_all_io_objects_for_fds(
|
127
|
+
close_all_io_objects_for_fds(file_descriptors_to_leave_open)
|
128
128
|
|
129
129
|
# At this point, RubyGems might have open file handles for which
|
130
130
|
# the associated file descriptors have just been closed. This can
|
@@ -55,7 +55,8 @@ class Application
|
|
55
55
|
return nil
|
56
56
|
end
|
57
57
|
|
58
|
-
|
58
|
+
search_results = Gem.cache.search(Gem::Dependency.new('rails', gem_version_spec), true)
|
59
|
+
found_version = search_results.map do |x|
|
59
60
|
x.version.version
|
60
61
|
end.sort.last
|
61
62
|
if found_version.nil?
|
@@ -63,7 +64,8 @@ class Application
|
|
63
64
|
# date because the Rails version may have been installed now.
|
64
65
|
# So we reload the RubyGems cache and try again.
|
65
66
|
Gem.clear_paths
|
66
|
-
|
67
|
+
search_results = Gem.cache.search(Gem::Dependency.new('rails', gem_version_spec), true)
|
68
|
+
found_version = search_results.map do |x|
|
67
69
|
x.version.version
|
68
70
|
end.sort.last
|
69
71
|
end
|
@@ -216,7 +216,7 @@ module Dependencies # :nodoc: all
|
|
216
216
|
end
|
217
217
|
elsif RUBY_PLATFORM =~ /freebsd/
|
218
218
|
dep.install_command = "make -C /usr/ports/www/apache22 install"
|
219
|
-
dep.provides = [Apache2_DevHeaders, APR_DevHeaders]
|
219
|
+
dep.provides = [Apache2_DevHeaders, APR_DevHeaders, APU_DevHeaders]
|
220
220
|
end
|
221
221
|
dep.website = "http://httpd.apache.org/"
|
222
222
|
end
|
@@ -270,6 +270,15 @@ module Dependencies # :nodoc: all
|
|
270
270
|
dep.website = "http://httpd.apache.org/"
|
271
271
|
dep.website_comments = "APR is an integrated part of Apache."
|
272
272
|
end
|
273
|
+
|
274
|
+
APU_DevHeaders = Dependency.new do |dep|
|
275
|
+
dep.name = "Apache Portable Runtime Utility (APR) development headers"
|
276
|
+
dep.define_checker do |result|
|
277
|
+
result.found(APU_CONFIG)
|
278
|
+
end
|
279
|
+
dep.website = "http://httpd.apache.org/"
|
280
|
+
dep.website_comments = "APR Utility is an integrated part of Apache."
|
281
|
+
end
|
273
282
|
|
274
283
|
FastThread = Dependency.new do |dep|
|
275
284
|
dep.name = "fastthread"
|
@@ -157,6 +157,42 @@ private
|
|
157
157
|
return [flags, libs]
|
158
158
|
end
|
159
159
|
end
|
160
|
+
|
161
|
+
def self.find_apu_config
|
162
|
+
if env_defined?('APU_CONFIG')
|
163
|
+
apu_config = ENV['APU_CONFIG']
|
164
|
+
elsif RUBY_PLATFORM =~ /darwin/ && HTTPD == "/usr/sbin/httpd"
|
165
|
+
# If we're on MacOS X, and we're compiling against the
|
166
|
+
# default provided Apache, then we'll want to query the
|
167
|
+
# correct 'apu-1-config' command. However, that command
|
168
|
+
# is not in $PATH by default. Instead, it lives in
|
169
|
+
# /Developer/SDKs/MacOSX*sdk/usr/bin.
|
170
|
+
sdk_dir = Dir["/Developer/SDKs/MacOSX*sdk"].sort.last
|
171
|
+
if sdk_dir
|
172
|
+
apu_config = "#{sdk_dir}/usr/bin/apu-1-config"
|
173
|
+
if !File.executable?(apu_config)
|
174
|
+
apu_config = nil
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else
|
178
|
+
apu_config = find_command('apu-1-config')
|
179
|
+
if apu_config.nil?
|
180
|
+
apu_config = find_command('apu-config')
|
181
|
+
end
|
182
|
+
end
|
183
|
+
return apu_config
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.determine_apu_info
|
187
|
+
if APU_CONFIG.nil?
|
188
|
+
return nil
|
189
|
+
else
|
190
|
+
flags = `#{APU_CONFIG} --includes`.strip
|
191
|
+
libs = `#{APU_CONFIG} --link-ld`.strip
|
192
|
+
flags.gsub!(/-O\d? /, '')
|
193
|
+
return [flags, libs]
|
194
|
+
end
|
195
|
+
end
|
160
196
|
|
161
197
|
def self.determine_multi_arch_flags
|
162
198
|
if RUBY_PLATFORM =~ /darwin/ && !HTTPD.nil?
|
@@ -248,12 +284,15 @@ public
|
|
248
284
|
HTTPD = find_httpd
|
249
285
|
# The absolute path to the 'apr-config' or 'apr-1-config' executable.
|
250
286
|
APR_CONFIG = find_apr_config
|
287
|
+
APU_CONFIG = find_apu_config
|
251
288
|
|
252
289
|
# The C compiler flags that are necessary to compile an Apache module.
|
253
290
|
APXS2_FLAGS = determine_apxs2_flags
|
254
291
|
# The C compiler flags that are necessary for programs that use APR.
|
255
292
|
APR_FLAGS, APR_LIBS = determine_apr_info
|
256
|
-
|
293
|
+
# The C compiler flags that are necessary for programs that use APR-Util.
|
294
|
+
APU_FLAGS, APU_LIBS = determine_apu_info
|
295
|
+
|
257
296
|
# The C compiler flags that are necessary for building binaries in the same architecture(s) as Apache.
|
258
297
|
MULTI_ARCH_FLAGS = determine_multi_arch_flags
|
259
298
|
# The current platform's shared library extension ('so' on most Unices).
|
@@ -19,6 +19,7 @@
|
|
19
19
|
require 'rubygems'
|
20
20
|
require 'socket'
|
21
21
|
require 'etc'
|
22
|
+
require 'fcntl'
|
22
23
|
require 'passenger/application'
|
23
24
|
require 'passenger/abstract_server'
|
24
25
|
require 'passenger/application'
|
@@ -260,7 +261,11 @@ private
|
|
260
261
|
if !defined?(Dispatcher)
|
261
262
|
require 'dispatcher'
|
262
263
|
end
|
263
|
-
|
264
|
+
if File.exist?('app/controllers/application_controller.rb')
|
265
|
+
require_dependency 'application_controller'
|
266
|
+
else
|
267
|
+
require_dependency 'application'
|
268
|
+
end
|
264
269
|
if GC.copy_on_write_friendly?
|
265
270
|
Dir.glob('app/{models,controllers,helpers}/*.rb').each do |file|
|
266
271
|
require_dependency normalize_path(file)
|
@@ -298,6 +303,7 @@ private
|
|
298
303
|
::ActiveRecord::Base.establish_connection
|
299
304
|
end
|
300
305
|
|
306
|
+
reader.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
|
301
307
|
handler = RequestHandler.new(reader)
|
302
308
|
channel.write(Process.pid, handler.socket_name,
|
303
309
|
handler.using_abstract_namespace?)
|
data/lib/passenger/utils.rb
CHANGED
@@ -81,15 +81,13 @@ protected
|
|
81
81
|
groupname && Etc.getgrnam(groupname)
|
82
82
|
end
|
83
83
|
|
84
|
-
def close_all_io_objects_for_fds(
|
85
|
-
ObjectSpace.each_object do |
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
o.close
|
90
|
-
end
|
91
|
-
rescue
|
84
|
+
def close_all_io_objects_for_fds(file_descriptors_to_leave_open)
|
85
|
+
ObjectSpace.each_object(IO) do |io|
|
86
|
+
begin
|
87
|
+
if !file_descriptors_to_leave_open.include?(io.fileno) && !io.closed?
|
88
|
+
io.close
|
92
89
|
end
|
90
|
+
rescue
|
93
91
|
end
|
94
92
|
end
|
95
93
|
end
|
data/lib/rake/gempackagetask.rb
CHANGED
@@ -11,12 +11,6 @@ require 'rake/packagetask'
|
|
11
11
|
require 'rubygems/user_interaction'
|
12
12
|
require 'rubygems/builder'
|
13
13
|
|
14
|
-
begin
|
15
|
-
Gem.manage_gems
|
16
|
-
rescue NoMethodError => ex
|
17
|
-
# Using rubygems prior to 0.6.1
|
18
|
-
end
|
19
|
-
|
20
14
|
module Rake
|
21
15
|
|
22
16
|
# Create a package based upon a Gem spec. Gem packages, as well as
|
data/lib/rake/rdoctask.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# Passenger note: this file is copied from Rake 0.8.1. The task names
|
3
|
-
# have been changed.
|
4
2
|
|
5
3
|
require 'rake'
|
6
4
|
require 'rake/tasklib'
|
@@ -12,7 +10,7 @@ module Rake
|
|
12
10
|
#
|
13
11
|
# The RDocTask will create the following targets:
|
14
12
|
#
|
15
|
-
# [<b
|
13
|
+
# [<b>:<em>rdoc</em></b>]
|
16
14
|
# Main task for this RDOC task.
|
17
15
|
#
|
18
16
|
# [<b>:clobber_<em>rdoc</em></b>]
|
@@ -23,13 +21,18 @@ module Rake
|
|
23
21
|
# Rebuild the rdoc files from scratch, even if they are not out
|
24
22
|
# of date.
|
25
23
|
#
|
26
|
-
# Simple
|
24
|
+
# Simple example:
|
27
25
|
#
|
28
26
|
# Rake::RDocTask.new do |rd|
|
29
27
|
# rd.main = "README.rdoc"
|
30
28
|
# rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
31
29
|
# end
|
32
30
|
#
|
31
|
+
# The +rd+ object passed to the block is an RDocTask object. See the
|
32
|
+
# attributes list for the RDocTask class for available customization options.
|
33
|
+
#
|
34
|
+
# == Specifying different task names
|
35
|
+
#
|
33
36
|
# You may wish to give the task a different name, such as if you are
|
34
37
|
# generating two sets of documentation. For instance, if you want to have a
|
35
38
|
# development set of documentation including private methods:
|
@@ -41,7 +44,17 @@ module Rake
|
|
41
44
|
# end
|
42
45
|
#
|
43
46
|
# The tasks would then be named :<em>rdoc_dev</em>, :clobber_<em>rdoc_dev</em>, and
|
44
|
-
# :re<em>rdoc_dev</em>.
|
47
|
+
# :re<em>rdoc_dev</em>.
|
48
|
+
#
|
49
|
+
# If you wish to have completely different task names, then pass a Hash as
|
50
|
+
# first argument. With the <tt>:rdoc</tt>, <tt>:clobber_rdoc</tt> and
|
51
|
+
# <tt>:rerdoc</tt> options, you can customize the task names to your liking.
|
52
|
+
# For example:
|
53
|
+
#
|
54
|
+
# Rake::RDocTask.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force")
|
55
|
+
#
|
56
|
+
# This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc_clean</tt> and
|
57
|
+
# <tt>:rdoc:force</tt>.
|
45
58
|
#
|
46
59
|
class RDocTask < TaskLib
|
47
60
|
# Name of the main, top level task. (default is :rdoc)
|
@@ -50,34 +63,45 @@ module Rake
|
|
50
63
|
# Name of directory to receive the html output files. (default is "html")
|
51
64
|
attr_accessor :rdoc_dir
|
52
65
|
|
53
|
-
# Title of RDoc documentation. (
|
66
|
+
# Title of RDoc documentation. (defaults to rdoc's default)
|
54
67
|
attr_accessor :title
|
55
68
|
|
56
69
|
# Name of file to be used as the main, top level file of the
|
57
70
|
# RDoc. (default is none)
|
58
71
|
attr_accessor :main
|
59
72
|
|
60
|
-
# Name of template to be used by rdoc. (
|
73
|
+
# Name of template to be used by rdoc. (defaults to rdoc's default)
|
61
74
|
attr_accessor :template
|
62
75
|
|
63
76
|
# List of files to be included in the rdoc generation. (default is [])
|
64
77
|
attr_accessor :rdoc_files
|
65
78
|
|
66
|
-
#
|
79
|
+
# Additional list of options to be passed rdoc. (default is [])
|
67
80
|
attr_accessor :options
|
68
81
|
|
69
|
-
#
|
82
|
+
# Whether to run the rdoc process as an external shell (default is false)
|
70
83
|
attr_accessor :external
|
71
|
-
|
72
|
-
|
73
|
-
|
84
|
+
|
85
|
+
attr_accessor :inline_source
|
86
|
+
|
87
|
+
# Create an RDoc task with the given name. See the RDocTask class overview
|
88
|
+
# for documentation.
|
89
|
+
def initialize(name = :rdoc) # :yield: self
|
90
|
+
if name.is_a?(Hash)
|
91
|
+
invalid_options = name.keys.map { |k| k.to_sym } - [:rdoc, :clobber_rdoc, :rerdoc]
|
92
|
+
if !invalid_options.empty?
|
93
|
+
raise ArgumentError, "Invalid option(s) passed to RDocTask.new: #{invalid_options.join(", ")}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
74
97
|
@name = name
|
75
98
|
@rdoc_files = Rake::FileList.new
|
76
99
|
@rdoc_dir = 'html'
|
77
100
|
@main = nil
|
78
101
|
@title = nil
|
79
|
-
@template =
|
102
|
+
@template = nil
|
80
103
|
@external = false
|
104
|
+
@inline_source = true
|
81
105
|
@options = []
|
82
106
|
yield self if block_given?
|
83
107
|
define
|
@@ -85,26 +109,28 @@ module Rake
|
|
85
109
|
|
86
110
|
# Create the tasks defined by this task lib.
|
87
111
|
def define
|
88
|
-
if
|
112
|
+
if rdoc_task_name != "rdoc"
|
89
113
|
desc "Build the RDOC HTML Files"
|
114
|
+
else
|
115
|
+
desc "Build the #{rdoc_task_name} HTML Files"
|
90
116
|
end
|
91
|
-
|
92
|
-
desc "Build the #{name} HTML Files"
|
93
|
-
task name
|
117
|
+
task rdoc_task_name
|
94
118
|
|
95
119
|
desc "Force a rebuild of the RDOC files"
|
96
|
-
task
|
120
|
+
task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
|
97
121
|
|
98
122
|
desc "Remove rdoc products"
|
99
|
-
task
|
123
|
+
task clobber_task_name do
|
100
124
|
rm_r rdoc_dir rescue nil
|
101
125
|
end
|
102
|
-
|
126
|
+
|
127
|
+
task :clobber => [clobber_task_name]
|
103
128
|
|
104
129
|
directory @rdoc_dir
|
105
|
-
task
|
106
|
-
file rdoc_target => @rdoc_files + [
|
130
|
+
task rdoc_task_name => [rdoc_target]
|
131
|
+
file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
|
107
132
|
rm_r @rdoc_dir rescue nil
|
133
|
+
@before_running_rdoc.call if @before_running_rdoc
|
108
134
|
args = option_list + @rdoc_files
|
109
135
|
if @external
|
110
136
|
argstring = args.join(' ')
|
@@ -123,6 +149,7 @@ module Rake
|
|
123
149
|
result << "--main" << quote(main) if main
|
124
150
|
result << "--title" << quote(title) if title
|
125
151
|
result << "-T" << quote(template) if template
|
152
|
+
result << "--inline-source" if inline_source && !@options.include?("--inline-source") && !@options.include?("-S")
|
126
153
|
result
|
127
154
|
end
|
128
155
|
|
@@ -137,12 +164,46 @@ module Rake
|
|
137
164
|
def option_string
|
138
165
|
option_list.join(' ')
|
139
166
|
end
|
167
|
+
|
168
|
+
# The block passed to this method will be called just before running the
|
169
|
+
# RDoc generator. It is allowed to modify RDocTask attributes inside the
|
170
|
+
# block.
|
171
|
+
def before_running_rdoc(&block)
|
172
|
+
@before_running_rdoc = block
|
173
|
+
end
|
140
174
|
|
141
175
|
private
|
142
|
-
|
176
|
+
|
143
177
|
def rdoc_target
|
144
178
|
"#{rdoc_dir}/index.html"
|
145
179
|
end
|
180
|
+
|
181
|
+
def rdoc_task_name
|
182
|
+
case name
|
183
|
+
when Hash
|
184
|
+
(name[:rdoc] || "rdoc").to_s
|
185
|
+
else
|
186
|
+
name.to_s
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def clobber_task_name
|
191
|
+
case name
|
192
|
+
when Hash
|
193
|
+
(name[:clobber_rdoc] || "clobber_rdoc").to_s
|
194
|
+
else
|
195
|
+
"clobber_#{name}"
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def rerdoc_task_name
|
200
|
+
case name
|
201
|
+
when Hash
|
202
|
+
(name[:rerdoc] || "rerdoc").to_s
|
203
|
+
else
|
204
|
+
"re#{name}"
|
205
|
+
end
|
206
|
+
end
|
146
207
|
|
147
208
|
end
|
148
209
|
end
|