Created
June 15, 2023 19:26
-
-
Save pdxjohnny/c249fdf1ae4a7c82fa700192d929485d to your computer and use it in GitHub Desktop.
dffml: Debug race condition
This file contains 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
diff --git a/dffml/df/memory.py b/dffml/df/memory.py | |
index fae38d786..10eed34b8 100644 | |
--- a/dffml/df/memory.py | |
+++ b/dffml/df/memory.py | |
@@ -381,6 +381,9 @@ class MemoryInputNetworkContext(BaseInputNetworkContext): | |
self.ctxhd[handle_string].by_origin[item.origin] = [] | |
# Add input to by origin set | |
self.ctxhd[handle_string].by_origin[item.origin].append(item) | |
+ # self.logger.getChild("add()").debug("self.ctxhd[%r].by_origin[%r].append(%r)", handle_string, item.origin, item) | |
+ | |
+ | |
async def uadd(self, *args: Input): | |
""" | |
@@ -604,6 +607,10 @@ class MemoryInputNetworkContext(BaseInputNetworkContext): | |
for ctx, _, by_origin in contexts: | |
# Ensure we were able to find a condition within the input | |
# network, and that when we found it it's value was True. | |
+ if "clone" in operation.name: | |
+ from pprint import pprint | |
+ pprint(locals()) | |
+ # breakpoint() | |
if not await self._check_conditions( | |
operation, dataflow, by_origin | |
): | |
@@ -1779,6 +1786,13 @@ class MemoryOrchestratorContext(BaseOrchestratorContext): | |
along with their operations as they are generated. | |
""" | |
# Get operations which may possibly run as a result of these new inputs | |
+ if new_input_set is not None: | |
+ async for i in new_input_set.inputs(): | |
+ print(i.definition.name) | |
+ # breakpoint() | |
+ if "valid_git_repository_URL" in i.definition.name: | |
+ # breakpoint() | |
+ pass | |
async for operation in self.octx.operations( | |
dataflow, input_set=new_input_set, stage=stage | |
): | |
@@ -1959,6 +1973,7 @@ class MemoryOrchestratorContext(BaseOrchestratorContext): | |
# Cancel tasks which we don't need anymore now that we know we are done | |
for task in tasks: | |
if not task.done(): | |
+ breakpoint() | |
task.cancel() | |
else: | |
task.exception() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment