Skip to content

Commit b2f8692

Browse files
fix error where N workers could be blocking each other if N cluster_get requests are made
1 parent 200e3fd commit b2f8692

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.02152627.css",
4-
"main.js": "/static/js/main.910dae05.js",
4+
"main.js": "/static/js/main.8c185340.js",
55
"static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
66
"static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
77
"static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
@@ -36,10 +36,10 @@
3636
"static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
3737
"index.html": "/index.html",
3838
"main.02152627.css.map": "/static/css/main.02152627.css.map",
39-
"main.910dae05.js.map": "/static/js/main.910dae05.js.map"
39+
"main.8c185340.js.map": "/static/js/main.8c185340.js.map"
4040
},
4141
"entrypoints": [
4242
"static/css/main.02152627.css",
43-
"static/js/main.910dae05.js"
43+
"static/js/main.8c185340.js"
4444
]
4545
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.910dae05.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.8c185340.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

pioreactorui/tasks.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ def write_config_and_sync(
296296
env=env,
297297
check=True,
298298
)
299-
logger.info(str(result))
300-
logger.debug(result)
299+
logger.info(result)
301300
if result.returncode != 0:
302301
raise Exception(result.stderr.strip())
303302

@@ -335,14 +334,17 @@ def multicast_post_across_cluster(
335334

336335
tasks = post_to_worker.map(((worker, endpoint, json) for worker in workers))
337336

338-
return {worker: response for (worker, response) in tasks.get(blocking=True)}
337+
return {
338+
worker: response for (worker, response) in tasks.get(blocking=True, timeout=30)
339+
} # add a timeout so that we don't hold up a thread forever.
339340

340341

341342
@huey.task()
342343
def get_from_worker(
343344
worker: str, endpoint: str, json: dict | None = None, timeout=1.0, return_raw=False
344345
) -> tuple[str, Any]:
345346
try:
347+
logger.info(timeout)
346348
r = get_from(resolve_to_address(worker), endpoint, json=json, timeout=timeout)
347349
r.raise_for_status()
348350
if not return_raw:
@@ -375,7 +377,9 @@ def multicast_get_across_cluster(
375377
((worker, endpoint, json, timeout, return_raw) for worker in workers)
376378
)
377379

378-
return {worker: response for (worker, response) in tasks.get(blocking=True)}
380+
return {
381+
worker: response for (worker, response) in tasks.get(blocking=True, timeout=30)
382+
} # add a timeout so that we don't hold up a thread forever.
379383

380384

381385
@huey.task()
@@ -405,7 +409,9 @@ def multicast_patch_across_cluster(
405409

406410
tasks = patch_to_worker.map(((worker, endpoint, json) for worker in workers))
407411

408-
return {worker: response for (worker, response) in tasks.get(blocking=True)}
412+
return {
413+
worker: response for (worker, response) in tasks.get(blocking=True, timeout=30)
414+
} # add a timeout so that we don't hold up a thread forever.
409415

410416

411417
@huey.task()
@@ -435,4 +441,6 @@ def multicast_delete_across_cluster(
435441

436442
tasks = delete_from_worker.map(((worker, endpoint, json) for worker in workers))
437443

438-
return {worker: response for (worker, response) in tasks.get(blocking=True)}
444+
return {
445+
worker: response for (worker, response) in tasks.get(blocking=True, timeout=30)
446+
} # add a timeout so that we don't hold up a thread forever.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.8c185340.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.910dae05.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)