Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions billiard/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,8 @@ def safe_apply_callback(self, fun, *args, **kwargs):
if fun:
try:
fun(*args, **kwargs)
except MemoryError:
raise
except self._callbacks_propagate:
raise
except Exception as exc:
Expand Down
9 changes: 9 additions & 0 deletions t/unit/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ def simple_task(x):
return x * 2

class test_pool:
def test_memory_error_from_callback_propagates(self):
def callback(value):
raise MemoryError(value)

result = billiard.pool.ApplyResult({}, callback)

with pytest.raises(MemoryError, match='out of memory'):
result._set(None, (True, 'out of memory'))

def test_raises(self):
pool = billiard.pool.Pool()
assert pool.did_start_ok() is True
Expand Down
Loading