Restrict worker result deserialization - #6444
Open
JanuszL wants to merge 3 commits into
Open
Conversation
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Contributor
|
| Filename | Overview |
|---|---|
| dali/python/nvidia/dali/_multiproc/messages.py | Normalizes arbitrary worker exceptions to RuntimeError and StopIteration, fully addressing the previously reported subclass behavior. |
| dali/python/nvidia/dali/_multiproc/shared_batch.py | Introduces an allowlisted worker-result unpickler while retaining generic deserialization for trusted parent-originated tasks. |
| dali/test/python/test_external_source_parallel_shared_batch.py | Tests rejection of unsafe globals and verifies that StopIteration subclasses retain termination semantics after serialization. |
Sequence Diagram
sequenceDiagram
participant Parent
participant Queue as Shared-memory queue
participant Worker
Parent->>Queue: "Task descriptor (worker_id = -1)"
Queue->>Worker: Trusted task payload
Worker->>Queue: CompletedTask and batch metadata
Queue->>Parent: Worker result descriptor
Parent->>Parent: Restricted protocol deserialization
Reviews (3): Last reviewed commit: "Preserve worker StopIteration semantics" | Re-trigger Greptile
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Contributor
Author
|
!build |
1 similar comment
Contributor
Author
|
!build |
Collaborator
|
CI MESSAGE: [61556838]: BUILD STARTED |
Collaborator
|
CI MESSAGE: [61556838]: BUILD PASSED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category:
Bug fix
Description:
Restrict deserialization of worker-to-parent shared-memory results to the internal multiprocessing protocol object graph.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
RuntimeError, andStopIteration.StopIterationworker exceptions are normalized before serialization.Tests:
-test_external_source_parallel_shared_batch.test_restricted_unpickler_normalizes_stop_iteration_subclasses
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A