mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (#96890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
14d4f68ebb
commit
19ca114645
3 changed files with 11 additions and 2 deletions
|
@ -5432,6 +5432,14 @@ class TestResourceTracker(unittest.TestCase):
|
|||
|
||||
self.assertTrue(is_resource_tracker_reused)
|
||||
|
||||
def test_too_long_name_resource(self):
|
||||
# gh-96819: Resource names that will make the length of a write to a pipe
|
||||
# greater than PIPE_BUF are not allowed
|
||||
rtype = "shared_memory"
|
||||
too_long_name_resource = "a" * (512 - len(rtype))
|
||||
with self.assertRaises(ValueError):
|
||||
resource_tracker.register(too_long_name_resource, rtype)
|
||||
|
||||
|
||||
class TestSimpleQueue(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue