You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ss...@apache.org on 2017/12/13 18:19:19 UTC
[1/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Repository: phoenix
Updated Branches:
refs/heads/4.x-HBase-0.98 c4706109e -> 361c2da6a
refs/heads/4.x-HBase-1.1 441539d1b -> 9d0a6bb7e
refs/heads/4.x-HBase-1.2 f93443c5d -> 1625dd620
refs/heads/4.x-cdh5.11.2 c49de1c5f -> bea0592c2
refs/heads/5.x-HBase-2.0 a54fd4aa6 -> 5019be449
refs/heads/master 1a19d1ecb -> 90c724161
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5019be44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5019be44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5019be44
Branch: refs/heads/5.x-HBase-2.0
Commit: 5019be449d3431b71e8245688369fa90a6bf4a82
Parents: a54fd4a
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:15:36 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5019be44/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')
[4/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Posted by ss...@apache.org.
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1625dd62
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1625dd62
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1625dd62
Branch: refs/heads/4.x-HBase-1.2
Commit: 1625dd62006301a612dde3b8fbfcbc15642a24dc
Parents: f93443c
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:17:24 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/1625dd62/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')
[3/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Posted by ss...@apache.org.
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/90c72416
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/90c72416
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/90c72416
Branch: refs/heads/master
Commit: 90c7241611667e3cd3689ce6a72762c6315231ef
Parents: 1a19d1e
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:16:54 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/90c72416/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')
[5/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Posted by ss...@apache.org.
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9d0a6bb7
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9d0a6bb7
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9d0a6bb7
Branch: refs/heads/4.x-HBase-1.1
Commit: 9d0a6bb7eed0b804f85b3a866b82332278c7161d
Parents: 441539d
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:18:15 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d0a6bb7/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')
[2/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Posted by ss...@apache.org.
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bea0592c
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bea0592c
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bea0592c
Branch: refs/heads/4.x-cdh5.11.2
Commit: bea0592c267ba40e3a8f115af19772c1ff82af1d
Parents: c49de1c
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:16:43 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bea0592c/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')
[6/6] phoenix git commit: PHOENIX-4456 queryserver script doesn't
perform as expected.
Posted by ss...@apache.org.
PHOENIX-4456 queryserver script doesn't perform as expected.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/361c2da6
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/361c2da6
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/361c2da6
Branch: refs/heads/4.x-HBase-0.98
Commit: 361c2da6abdc10908021a807c7022b60a3e444d1
Parents: c470610
Author: Sergey Soldatov <ss...@apache.org>
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Dec 13 10:18:45 2017 -0800
----------------------------------------------------------------------
bin/daemon.py | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/361c2da6/bin/daemon.py
----------------------------------------------------------------------
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
import socket
import atexit
import fcntl
+import time
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
change_process_owner(self.uid, self.gid)
if self.detach_process:
- detach_process_context()
+ detach_process_context(self.pidfile)
signal_handler_map = self._make_signal_handler_map()
set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
resource.setrlimit(core_resource, core_limit)
-def detach_process_context():
+def detach_process_context(pidfile):
""" Detach the process context from parent and session.
:return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
try:
pid = os.fork()
if pid > 0:
+ while not os.path.exists(pidfile.path):
+ time.sleep(0.1)
os._exit(0)
except OSError as exc:
error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
def __init__(self, path, enter_err_msg=None):
self.path = path
self.enter_err_msg = enter_err_msg
- self.pidfile = None
+ self.pidfile = open(self.path, 'a+')
+ try:
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+ fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+ self.pidfile.close()
+ os.remove(self.path)
+ except IOError:
+ sys.exit(self.enter_err_msg)
def __enter__(self):
self.pidfile = open(self.path, 'a+')