未验证 提交 9c4a885b 编写于 作者: P Paul Guo 提交者: GitHub

Ship subprocess32 and replace subprocess with it in python code (#8658)

* Ship modified python module subprocess32 again

subprocess32 is preferred over subprocess according to python documentation.
In addition we long ago modified the code to use vfork() against fork() to
avoid some "Cannot allocate memory" kind of error (false alarm though - memory
is actually sufficient) on gpdb product environment that is usually with memory
overcommit disabled.  And we compiled and shipped it also but later it was just
compiled but not shipped somehow due to makefile change (maybe a regression).
Let's ship it again.

* Replace subprocess with our own subprocess32 in python code.
上级 0439ae41
......@@ -28,7 +28,10 @@ Assuming all of the above, you can just run the tool as so:
import argparse
import os
import sys
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import threading
import datetime
import time
......
......@@ -30,6 +30,10 @@ install: generate_greenplum_path_file
if [ -e bin/ext/yaml ]; then \
cp -rp bin/ext/yaml $(DESTDIR)$(prefix)/lib/python ; \
fi
if [ -e bin/ext/subprocess32.py ]; then \
cp -p bin/ext/subprocess32.py $(DESTDIR)$(prefix)/lib/python ; \
cp -p bin/ext/_posixsubprocess.so $(DESTDIR)$(prefix)/lib/python ; \
fi
clean distclean:
$(MAKE) -C bin $@
......@@ -49,7 +49,11 @@ except Exception, e:
sys.exit(2)
import hashlib
import datetime,getpass,os,signal,socket,subprocess,threading,time,traceback,re
import datetime,getpass,os,signal,socket,threading,time,traceback,re
try:
import subprocess32 as subprocess
except:
import subprocess
import uuid
from gppylib.gpversion import GpVersion
......
......@@ -10,7 +10,10 @@ import socket
import fileinput
import platform
import re
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
from pygresql import pg
"""
......
......@@ -9,7 +9,10 @@ import socket
import fileinput
import platform
import re
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
from pygresql import pg
def get_port_from_conf():
......
......@@ -9,7 +9,10 @@ import socket
import fileinput
import platform
import re
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
from shutil import copyfile
from pygresql import pg
......
......@@ -21,7 +21,10 @@ from threading import Thread
import os
import signal
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import sys
import time
......
......@@ -3,7 +3,10 @@
import os, signal, time, re
import unittest
import psutil
from subprocess import PIPE
try:
from subprocess32 import PIPE
except:
from subprocess import PIPE
class GpsshTestCase(unittest.TestCase):
......
......@@ -2,7 +2,10 @@ import os
from mock import *
from gp_unittest import *
from StringIO import StringIO
from subprocess import Popen, PIPE
try:
from subprocess32 import Popen, PIPE
except:
from subprocess import Popen, PIPE
class GpInitSystemTest(GpTestCase):
def setUp(self):
......
import shutil, filecmp,re
import os, fcntl, select, getpass, socket
import stat
from subprocess import *
try:
from subprocess32 import *
except:
from subprocess import *
from sys import *
from xml.dom import minidom
from xml.dom import Node
......
from os import path
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
from gppylib.db import dbconn
from gppylib.gparray import GpArray
......
......@@ -2,7 +2,10 @@ from os import path
import os
import shutil
import socket
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import sys
import tempfile
......
......@@ -15,7 +15,10 @@ import tarfile
import tempfile
import thread
import json
from subprocess import Popen, PIPE
try:
from subprocess32 import Popen, PIPE
except:
from subprocess import Popen, PIPE
import commands
import signal
from collections import defaultdict
......
import glob
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
try:
from subprocess32 import Popen, PIPE
except:
from subprocess import Popen, PIPE
from utils import run_gpcommand
from gppylib.commands.base import Command
......
......@@ -8,7 +8,10 @@ import stat
import time
import glob
import shutil
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import difflib
import yaml
......
......@@ -30,7 +30,10 @@ gp_replica_check.py -d "mydb1,mydb2,..." -r "hash,bitmap,gist,..."
import argparse
import sys
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import threading
import Queue
import pipes # for shell-quoting, pipes.quote()
......
......@@ -17,7 +17,10 @@ limitations under the License.
import pygresql.pg
import os
import subprocess
try:
import subprocess32 as subprocess
except:
import subprocess
import re
import multiprocessing
import tempfile
......
......@@ -9,7 +9,11 @@ mkpath = lambda *x: os.path.join(MYD, *x)
#globals
SAMPLE_QUERY="(select count(*) from (select o0.o_orderkey from (heap_orders o0 left outer join heap_orders o1 on o0.o_orderkey = o1.o_orderkey left outer join heap_orders o2 on o2.o_orderkey = o1.o_orderkey left outer join heap_orders o3 on o3.o_orderkey = o2.o_orderkey left outer join heap_orders o4 on o4.o_orderkey = o3.o_orderkey) order by o0.o_orderkey) as foo);"
import subprocess, shutil, time, re
import shutil, time, re
try:
import subprocess32 as subprocess
except:
import subprocess
from optparse import OptionParser, OptionGroup
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册