Skip to content

Commit a5846d9

Browse files
committed
Removing the master and slave language
1 parent 8cd42e8 commit a5846d9

10 files changed

Lines changed: 52 additions & 52 deletions

File tree

lib/python3.6/site-packages/gunicorn/arbiter.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def __init__(self, app):
6363
self.systemd = False
6464
self.worker_age = 0
6565
self.reexec_pid = 0
66-
self.master_pid = 0
67-
self.master_name = "Master"
66+
self.main_pid = 0
67+
self.main_name = "Main"
6868

6969
cwd = util.getcwd()
7070

@@ -126,14 +126,14 @@ def start(self):
126126
self.log.info("Starting gunicorn %s", __version__)
127127

128128
if 'GUNICORN_PID' in os.environ:
129-
self.master_pid = int(os.environ.get('GUNICORN_PID'))
129+
self.main_pid = int(os.environ.get('GUNICORN_PID'))
130130
self.proc_name = self.proc_name + ".2"
131-
self.master_name = "Master.2"
131+
self.main_name = "Main.2"
132132

133133
self.pid = os.getpid()
134134
if self.cfg.pidfile is not None:
135135
pidname = self.cfg.pidfile
136-
if self.master_pid != 0:
136+
if self.main_pid != 0:
137137
pidname += ".2"
138138
self.pidfile = Pidfile(pidname)
139139
self.pidfile.create(self.pid)
@@ -149,7 +149,7 @@ def start(self):
149149
fds = range(systemd.SD_LISTEN_FDS_START,
150150
systemd.SD_LISTEN_FDS_START + listen_fds)
151151

152-
elif self.master_pid:
152+
elif self.main_pid:
153153
fds = []
154154
for fd in os.environ.pop('GUNICORN_FD').split(','):
155155
fds.append(int(fd))
@@ -169,8 +169,8 @@ def start(self):
169169

170170
def init_signals(self):
171171
"""\
172-
Initialize master signal handling. Most of the signals
173-
are queued. Child signals only wake up the master.
172+
Initialize main signal handling. Most of the signals
173+
are queued. Child signals only wake up the main.
174174
"""
175175
# close old PIPE
176176
for p in self.PIPE:
@@ -195,15 +195,15 @@ def signal(self, sig, frame):
195195
self.wakeup()
196196

197197
def run(self):
198-
"Main master loop."
198+
"Main main loop."
199199
self.start()
200-
util._setproctitle("master [%s]" % self.proc_name)
200+
util._setproctitle("main [%s]" % self.proc_name)
201201

202202
try:
203203
self.manage_workers()
204204

205205
while True:
206-
self.maybe_promote_master()
206+
self.maybe_promote_main()
207207

208208
sig = self.SIG_QUEUE.pop(0) if self.SIG_QUEUE else None
209209
if sig is None:
@@ -252,7 +252,7 @@ def handle_hup(self):
252252
- Start the new worker processes with a new configuration
253253
- Gracefully shutdown the old worker processes
254254
"""
255-
self.log.info("Hang up: %s", self.master_name)
255+
self.log.info("Hang up: %s", self.main_name)
256256
self.reload()
257257

258258
def handle_term(self):
@@ -298,8 +298,8 @@ def handle_usr1(self):
298298
def handle_usr2(self):
299299
"""\
300300
SIGUSR2 handling.
301-
Creates a new master/worker set as a slave of the current
302-
master without affecting old workers. Use this to do live
301+
Creates a new main/worker set as a subordinate of the current
302+
main without affecting old workers. Use this to do live
303303
deployment with the ability to backout a change.
304304
"""
305305
self.reexec()
@@ -313,22 +313,22 @@ def handle_winch(self):
313313
else:
314314
self.log.debug("SIGWINCH ignored. Not daemonized")
315315

316-
def maybe_promote_master(self):
317-
if self.master_pid == 0:
316+
def maybe_promote_main(self):
317+
if self.main_pid == 0:
318318
return
319319

320-
if self.master_pid != os.getppid():
321-
self.log.info("Master has been promoted.")
322-
# reset master infos
323-
self.master_name = "Master"
324-
self.master_pid = 0
320+
if self.main_pid != os.getppid():
321+
self.log.info("Main has been promoted.")
322+
# reset main infos
323+
self.main_name = "Main"
324+
self.main_pid = 0
325325
self.proc_name = self.cfg.proc_name
326326
del os.environ['GUNICORN_PID']
327327
# rename the pidfile
328328
if self.pidfile is not None:
329329
self.pidfile.rename(self.cfg.pidfile)
330330
# reset proctitle
331-
util._setproctitle("master [%s]" % self.proc_name)
331+
util._setproctitle("main [%s]" % self.proc_name)
332332

333333
def wakeup(self):
334334
"""\
@@ -343,7 +343,7 @@ def wakeup(self):
343343
def halt(self, reason=None, exit_status=0):
344344
""" halt arbiter """
345345
self.stop()
346-
self.log.info("Shutting down: %s", self.master_name)
346+
self.log.info("Shutting down: %s", self.main_name)
347347
if reason is not None:
348348
self.log.info("Reason: %s", reason)
349349
if self.pidfile is not None:
@@ -378,7 +378,7 @@ def stop(self, graceful=True):
378378
killed gracefully (ie. trying to wait for the current connection)
379379
"""
380380

381-
unlink = self.reexec_pid == self.master_pid == 0 and not self.systemd
381+
unlink = self.reexec_pid == self.main_pid == 0 and not self.systemd
382382
sock.close_sockets(self.LISTENERS, unlink)
383383

384384
self.LISTENERS = []
@@ -396,25 +396,25 @@ def stop(self, graceful=True):
396396

397397
def reexec(self):
398398
"""\
399-
Relaunch the master and workers.
399+
Relaunch the main and workers.
400400
"""
401401
if self.reexec_pid != 0:
402402
self.log.warning("USR2 signal ignored. Child exists.")
403403
return
404404

405-
if self.master_pid != 0:
405+
if self.main_pid != 0:
406406
self.log.warning("USR2 signal ignored. Parent exists.")
407407
return
408408

409-
master_pid = os.getpid()
409+
main_pid = os.getpid()
410410
self.reexec_pid = os.fork()
411411
if self.reexec_pid != 0:
412412
return
413413

414414
self.cfg.pre_exec(self)
415415

416416
environ = self.cfg.env_orig.copy()
417-
environ['GUNICORN_PID'] = str(master_pid)
417+
environ['GUNICORN_PID'] = str(main_pid)
418418

419419
if self.systemd:
420420
environ['LISTEN_PID'] = str(os.getpid())
@@ -474,7 +474,7 @@ def reload(self):
474474
self.pidfile.create(self.pid)
475475

476476
# set new proc_name
477-
util._setproctitle("master [%s]" % self.proc_name)
477+
util._setproctitle("main [%s]" % self.proc_name)
478478

479479
# spawn new workers
480480
for _ in range(self.cfg.workers):
@@ -609,7 +609,7 @@ def spawn_workers(self):
609609
Spawn new workers as needed.
610610
611611
This is where a worker process leaves the main loop
612-
of the master process.
612+
of the main process.
613613
"""
614614

615615
for _ in range(self.num_workers - len(self.WORKERS.keys())):

lib/python3.6/site-packages/gunicorn/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ def on_starting(server):
15471547
pass
15481548
default = staticmethod(on_starting)
15491549
desc = """\
1550-
Called just before the master process is initialized.
1550+
Called just before the main process is initialized.
15511551
15521552
The callable needs to accept a single instance variable for the Arbiter.
15531553
"""
@@ -1684,7 +1684,7 @@ def pre_exec(server):
16841684
pass
16851685
default = staticmethod(pre_exec)
16861686
desc = """\
1687-
Called just before a new master process is forked.
1687+
Called just before a new main process is forked.
16881688
16891689
The callable needs to accept a single instance variable for the Arbiter.
16901690
"""
@@ -1734,7 +1734,7 @@ def child_exit(server, worker):
17341734
pass
17351735
default = staticmethod(child_exit)
17361736
desc = """\
1737-
Called just after a worker has been exited, in the master process.
1737+
Called just after a worker has been exited, in the main process.
17381738
17391739
The callable needs to accept two instance variables for the Arbiter and
17401740
the just-exited Worker.

lib/python3.6/site-packages/gunicorn/workers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def notify(self):
6464
"""\
6565
Your worker subclass must arrange to have this method called
6666
once every ``self.timeout`` seconds. If you fail in accomplishing
67-
this task, the master process will murder your workers.
67+
this task, the main process will murder your workers.
6868
"""
6969
self.tmp.notify()
7070

lib/python3.6/site-packages/mysql/connector/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ class RefreshOption(_Constants):
545545
'HOSTS': (1 << 3, 'Flush host cache'),
546546
'STATUS': (1 << 4, 'Flush status variables'),
547547
'THREADS': (1 << 5, 'Flush thread cache'),
548-
'SLAVE': (1 << 6, 'Reset master info and restart slave thread'),
548+
'SLAVE': (1 << 6, 'Reset main info and restart subordinate thread'),
549549
}
550550

551551

lib/python3.6/site-packages/mysql/connector/locales/eng/client_error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
CR_EMBEDDED_CONNECTION = u"Embedded server"
5858
CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:"
5959
CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:"
60-
CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:"
61-
CR_PROBE_MASTER_CONNECT = u"Error connecting to master:"
60+
CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:"
61+
CR_PROBE_MASTER_CONNECT = u"Error connecting to main:"
6262
CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s"
6363
CR_MALFORMED_PACKET = u"Malformed packet"
6464
CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license"

lib/python3.6/site-packages/mysqlx/locales/eng/client_error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
CR_EMBEDDED_CONNECTION = u"Embedded server"
5858
CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:"
5959
CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:"
60-
CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:"
61-
CR_PROBE_MASTER_CONNECT = u"Error connecting to master:"
60+
CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:"
61+
CR_PROBE_MASTER_CONNECT = u"Error connecting to main:"
6262
CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s"
6363
CR_MALFORMED_PACKET = u"Malformed packet"
6464
CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license"

lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,9 @@ def __init__(self, entries=None):
644644
self.add_entry(entry)
645645

646646
@classmethod
647-
def _build_master(cls):
647+
def _build_main(cls):
648648
"""
649-
Prepare the master working set.
649+
Prepare the main working set.
650650
"""
651651
ws = cls()
652652
try:
@@ -3016,9 +3016,9 @@ def _initialize(g=globals()):
30163016

30173017

30183018
@_call_aside
3019-
def _initialize_master_working_set():
3019+
def _initialize_main_working_set():
30203020
"""
3021-
Prepare the master working set and make the ``require()``
3021+
Prepare the main working set and make the ``require()``
30223022
API available.
30233023
30243024
This function has explicit effects on the global state
@@ -3028,7 +3028,7 @@ def _initialize_master_working_set():
30283028
Invocation by other packages is unsupported and done
30293029
at their own risk.
30303030
"""
3031-
working_set = WorkingSet._build_master()
3031+
working_set = WorkingSet._build_main()
30323032
_declare_state('object', working_set=working_set)
30333033

30343034
require = working_set.require

lib/python3.6/site-packages/pip/vcs/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def update(self, dest, rev_options):
118118
self.run_command(['fetch', '-q', '--tags'], cwd=dest)
119119
else:
120120
self.run_command(['fetch', '-q'], cwd=dest)
121-
# Then reset to wanted revision (maybe even origin/master)
121+
# Then reset to wanted revision (maybe even origin/main)
122122
if rev_options:
123123
rev_options = self.check_rev_options(
124124
rev_options[0], dest, rev_options,
@@ -133,7 +133,7 @@ def obtain(self, dest):
133133
rev_options = [rev]
134134
rev_display = ' (to %s)' % rev
135135
else:
136-
rev_options = ['origin/master']
136+
rev_options = ['origin/main']
137137
rev_display = ''
138138
if self.check_destination(dest, url, rev_options, rev_display):
139139
logger.info(

lib/python3.6/site-packages/pkg_resources/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,9 @@ def __init__(self, entries=None):
643643
self.add_entry(entry)
644644

645645
@classmethod
646-
def _build_master(cls):
646+
def _build_main(cls):
647647
"""
648-
Prepare the master working set.
648+
Prepare the main working set.
649649
"""
650650
ws = cls()
651651
try:
@@ -3015,9 +3015,9 @@ def _initialize(g=globals()):
30153015

30163016

30173017
@_call_aside
3018-
def _initialize_master_working_set():
3018+
def _initialize_main_working_set():
30193019
"""
3020-
Prepare the master working set and make the ``require()``
3020+
Prepare the main working set and make the ``require()``
30213021
API available.
30223022
30233023
This function has explicit effects on the global state
@@ -3027,7 +3027,7 @@ def _initialize_master_working_set():
30273027
Invocation by other packages is unsupported and done
30283028
at their own risk.
30293029
"""
3030-
working_set = WorkingSet._build_master()
3030+
working_set = WorkingSet._build_main()
30313031
_declare_state('object', working_set=working_set)
30323032

30333033
require = working_set.require

lib/python3.6/site-packages/setuptools/command/easy_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ def update_dist_caches(dist_path, fix_zipimporter_caches):
17281728
# There are several other known sources of stale zipimport.zipimporter
17291729
# instances that we do not clear here, but might if ever given a reason to
17301730
# do so:
1731-
# * Global setuptools pkg_resources.working_set (a.k.a. 'master working
1731+
# * Global setuptools pkg_resources.working_set (a.k.a. 'main working
17321732
# set') may contain distributions which may in turn contain their
17331733
# zipimport.zipimporter loaders.
17341734
# * Several zipimport.zipimporter loaders held by local variables further

0 commit comments

Comments
 (0)