Skip to content

Commit 9702a2e

Browse files
committed
Msgpack sadness FUCKING AGAIN.
Every time I update. Arrrrrgh. Also citext continues to be broken. And both `mprpc` and `sqlalchemy-citext` seem to be unmaintained at this point. Sigh.
1 parent 3d552ca commit 9702a2e

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

WebMirror/JobDispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def acquire_timeout(lock, timeout):
7878

7979
largv = [tmp.lower() for tmp in sys.argv]
8080
if "twoprocess" in largv or "oneprocess" in largv:
81-
MAX_IN_FLIGHT_JOBS = 10
81+
MAX_IN_FLIGHT_JOBS = 3
8282
else:
8383
# MAX_IN_FLIGHT_JOBS = 10
8484
# MAX_IN_FLIGHT_JOBS = 75

common/get_rpyc.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
import mprpc
1212
import config
1313

14+
PACK_PARAMS = {
15+
"use_bin_type":True,
16+
}
17+
18+
UNPACK_PARAMS = {
19+
'raw' : True,
20+
'max_buffer_size' : 2**31-1,
21+
'max_str_len' : 2**31-1,
22+
'max_bin_len' : 2**31-1,
23+
'max_array_len' : 2**31-1,
24+
'max_map_len' : 2**31-1,
25+
'max_ext_len' : 2**31-1,
26+
}
1427

1528

1629

@@ -33,18 +46,10 @@ def __init__(self, interfacename):
3346
self.rpc_client = mprpc.RPCClient(
3447
host = config.C_RPC_AGENT_HOST,
3548
port = 4315,
36-
pack_params = {
37-
"use_bin_type":True,
38-
},
39-
unpack_params = {
40-
'raw' : True,
41-
'max_buffer_size' : 2**31-1,
42-
'max_str_len' : 2**31-1,
43-
'max_bin_len' : 2**31-1,
44-
'max_array_len' : 2**31-1,
45-
'max_map_len' : 2**31-1,
46-
'max_ext_len' : 2**31-1,
47-
},
49+
unpack_encoding = 'utf-8',
50+
pack_encoding = 'utf-8',
51+
pack_params = PACK_PARAMS,
52+
unpack_params = UNPACK_PARAMS,
4853
)
4954

5055

@@ -132,13 +137,16 @@ def __init__(self):
132137
for x in range(99999):
133138
try:
134139
self.log.info("Creating rpc_client")
135-
# self.log.info("Current stack:")
136-
# for line in "\n".join(traceback.format_stack()).strip().split("\n"):
137-
# self.log.info("%s", line.rstrip())
138-
# self.log.info("------------")
139140

140-
mp_conf = {"use_bin_type" : True}
141-
self.rpc_client = mprpc.RPCClient(config.C_SYNC_RPC_SERVER, 4315, pack_params=mp_conf, timeout=90)
141+
self.rpc_client = mprpc.RPCClient(
142+
host = config.C_SYNC_RPC_SERVER,
143+
port = 4315,
144+
unpack_encoding = 'utf-8',
145+
pack_encoding = 'utf-8',
146+
pack_params = PACK_PARAMS,
147+
unpack_params = UNPACK_PARAMS,
148+
timeout = 90,
149+
)
142150
self.log.info("Validating RPC connection")
143151

144152
self.check_ok()

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ xmljson==0.2.1
2525
pystuck==0.8.5
2626
cherrypy==18.6.1
2727

28+
# Pin to 0.6.2 since 1.0.0 is broken in mprpc
29+
msgpack==0.6.2
30+
2831
psycopg2cffi==2.9.0; platform.python_implementation == 'PyPy'
2932
psycopg2==2.9.3; platform.python_implementation == 'CPython'
3033

3134
SQLAlchemy<1.4.0
32-
sqlalchemy-citext==1.8.0; platform.python_implementation == 'PyPy'
35+
sqlalchemy-citext<1.8.0; platform.python_implementation == 'PyPy'
3336
sqlalchemy-citext==1.8.0; platform.python_implementation == 'CPython'
3437

3538
PySocks==1.7.1

0 commit comments

Comments
 (0)