Quick workaround for ray.wait bug. (#42)

This commit is contained in:
Robert Nishihara
2016-11-22 13:31:22 -08:00
committed by Philipp Moritz
parent 35ce5f8001
commit a93c6b7596
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -1005,7 +1005,7 @@ def wait(object_ids, num_returns=1, timeout=None, worker=global_worker):
"""
check_connected(worker)
object_id_strs = [object_id.id() for object_id in object_ids]
timeout = timeout if timeout is not None else 2 ** 36
timeout = timeout if timeout is not None else 2 ** 30
ready_ids, remaining_ids = worker.plasma_client.wait(object_id_strs, timeout, num_returns)
ready_ids = [photon.ObjectID(object_id) for object_id in ready_ids]
remaining_ids = [photon.ObjectID(object_id) for object_id in remaining_ids]
+1 -1
View File
@@ -6,7 +6,7 @@ import time
import libplasma
PLASMA_ID_SIZE = 20
PLASMA_WAIT_TIMEOUT = 2 ** 36
PLASMA_WAIT_TIMEOUT = 2 ** 30
class PlasmaBuffer(object):
"""This is the type of objects returned by calls to get with a PlasmaClient.
+6
View File
@@ -189,6 +189,12 @@ PyObject *PyPlasma_wait(PyObject *self, PyObject *args) {
"The argument num_returns cannot be greater than len(object_ids)");
return NULL;
}
int64_t threshold = 1 << 30;
if (timeout > threshold) {
PyErr_SetString(PyExc_RuntimeError,
"The argument timeout cannot be greater than 2 ** 30.");
return NULL;
}
object_id *object_ids = malloc(sizeof(object_id) * n);
for (int i = 0; i < n; ++i) {