Title: inconsistent behavior concerning multiprocessing.manager.BaseManager._Server
Type: behavior Stage: needs patch
Components: Extension Modules Versions: Python 3.6, Python 3.5, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: sbt Nosy List: asksol, berker.peksag, chrysn, davin, jnoller, ppperry, sbt
Priority: normal Keywords: easy

Created on 2011-01-07 00:32 by chrysn, last changed 2016-05-01 21:18 by ppperry.

Messages (3)
msg125606 - (view) Author: chrysn (chrysn) * Date: 2011-01-07 00:32
The multiprocessing.manager.BaseManager class has a class property called _Server, defaulting to multiprocessing.manager.Server, that is used in the ._run_server method (typically invoked via .run()) to determine the class of the server that is to be created.

On the other hand, the .get_server() method creates an instance of Server independent of what is configured in ._Server. Thus, managers started via .run() behave slightly different than those started with .get_server().serve_forever(), and in a way that is hard to track.

I am aware that the ._Server property is undocumented, but it's quite useful when extending BaseManager in a way that it needs to be configured by the server.

I suggest to have .get_server() use ._Server instead of Server; I can't think of situations in which this does the wrong thing (rather, I assume that up to now, users of ._Server didn't try running with .get_server().serve_forever(); it seems ._Server is not used in the standard library).
msg220889 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-17 20:59
Can we have a response to this please.
msg264609 - (view) Author: (ppperry) Date: 2016-05-01 21:18
You're working with non-documented internal components of the python standard library with names that start with an underscore. I think that this is not a bug in python, but instead a consequence of mucking with internals that weren't designed to be mucked with.
Date User Action Args
2016-05-01 21:18:25ppperrysetnosy: + ppperry
messages: + msg264609
2016-04-29 20:43:13BreamoreBoysetnosy: - BreamoreBoy
2016-04-29 10:40:56berker.peksagsetkeywords: + easy
nosy: + berker.peksag, davin
stage: needs patch

versions: + Python 3.6, - Python 3.4
2014-06-28 17:47:31sbtsetassignee: sbt
2014-06-17 20:59:22BreamoreBoysetversions: + Python 2.7, Python 3.4, Python 3.5, - Python 3.2
nosy: + BreamoreBoy, sbt

messages: + msg220889

components: + Extension Modules, - None
2011-01-08 05:38:27ned.deilysetnosy: + asksol, jnoller
2011-01-07 00:32:52chrysncreate