[Groonga-commit] groonga/groonga at 73224e9 [master] deb rpm: restricts max execution time to prevent hanging

Back to archive index

HAYASHI Kentaro null+****@clear*****
Mon May 20 17:06:07 JST 2013


HAYASHI Kentaro	2013-05-20 17:06:07 +0900 (Mon, 20 May 2013)

  New Revision: 73224e9be6d822f752f188d2afc70b7d8d6a61f1
  https://github.com/groonga/groonga/commit/73224e9be6d822f752f188d2afc70b7d8d6a61f1

  Message:
    deb rpm: restricts max execution time to prevent hanging
    
    GitHub: #61
    
    Reported by firewood. Thanks!!!

  Modified files:
    data/init.d/redhat/groonga-server-http
    data/init.d/redhat/sysconfig/groonga-server-http
    packages/debian/groonga-server-http.default
    packages/debian/groonga-server-http.init

  Modified: data/init.d/redhat/groonga-server-http (+2 -1)
===================================================================
--- data/init.d/redhat/groonga-server-http    2013-05-20 12:27:41 +0900 (3d05e2f)
+++ data/init.d/redhat/groonga-server-http    2013-05-20 17:06:07 +0900 (3f7a424)
@@ -35,6 +35,7 @@ LOG_PATH=/var/log/groonga/groonga-http.log
 QUERY_LOG_PATH=/var/log/groonga/query-http.log
 OPTION_ARGS=""
 GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
+COMMAND_TIMEOUT=5
 
 if [ -f /etc/sysconfig/$name ]; then
 	. /etc/sysconfig/$name
@@ -109,7 +110,7 @@ RETVAL=0
 
 send_command() {
 	command=$1
-	$curl "http://${ADDRESS}:${PORT}/d/${command}"
+	$curl --max-time $COMMAND_TIMEOUT "http://${ADDRESS}:${PORT}/d/${command}"
 }
 
 start() {

  Modified: data/init.d/redhat/sysconfig/groonga-server-http (+1 -0)
===================================================================
--- data/init.d/redhat/sysconfig/groonga-server-http    2013-05-20 12:27:41 +0900 (4787a2c)
+++ data/init.d/redhat/sysconfig/groonga-server-http    2013-05-20 17:06:07 +0900 (dbca329)
@@ -8,3 +8,4 @@
 #QUERY_LOG_PATH=/var/log/groonga/query-http.log
 #PROTOCOL=http
 #GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
+#COMMAND_TIMEOUT=5

  Modified: packages/debian/groonga-server-http.default (+1 -0)
===================================================================
--- packages/debian/groonga-server-http.default    2013-05-20 12:27:41 +0900 (c513f2d)
+++ packages/debian/groonga-server-http.default    2013-05-20 17:06:07 +0900 (ea06057)
@@ -8,6 +8,7 @@
 #QUERY_LOG_PATH=/var/log/groonga/query-http.log
 #PROTOCOL=http
 #GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
+#COMMAND_TIMEOUT=5
 
 # Comment out this to disable groonga daemon.
 ENABLE=yes

  Modified: packages/debian/groonga-server-http.init (+2 -1)
===================================================================
--- packages/debian/groonga-server-http.init    2013-05-20 12:27:41 +0900 (475b97b)
+++ packages/debian/groonga-server-http.init    2013-05-20 17:06:07 +0900 (0057ed8)
@@ -31,6 +31,7 @@ PIDFILE=/var/run/groonga/$NAME-$PROTOCOL.pid
 SCRIPTNAME=/etc/init.d/$NAME-server-$PROTOCOL
 OPTION_ARGS=""
 START_STOP_DAEMON_ARGS=""
+COMMAND_TIMEOUT=5
 ENABLE="no"
 
 DEFAULT_FILE=/etc/default/groonga-server-http
@@ -106,7 +107,7 @@ send_command()
 {
     command=$1
     if [ "${PROTOCOL}" = "http" ]; then
-	$CURL "http://${ADDRESS}:${PORT}/d/${command}"
+	$CURL --max-time $COMMAND_TIMEOUT "http://${ADDRESS}:${PORT}/d/${command}"
     else
         $DAEMON --port ${PORT} -c ${ADDRESS} ${command}
     fi
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index