Skip to content

Commit c3136a7

Browse files
committed
Don't include self in producer graph
1 parent a08077d commit c3136a7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugboard/component/component.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ async def _wrapper() -> None:
240240

241241
async def _build_producer_graph(self) -> None:
242242
"""Builds the producer graph for the component."""
243-
# TODO : How to handle the case of recursion, i.e., a component which is both a producer and
244-
# : consumer of a given event?
245243
if not (self._state and self._state_is_connected):
246244
self._logger.warning("State backend not connected. Cannot build producer graph.")
247245
return
@@ -250,6 +248,10 @@ async def _build_producer_graph(self) -> None:
250248
input_event_set.remove(StopEvent.safe_type())
251249
for comp_id, comp_data in process["components"].items():
252250
for evt in input_event_set.intersection(comp_data["io"]["output_events"]):
251+
if comp_id == self.id:
252+
# TODO : How to handle the case of recursion, i.e., a component which is both
253+
# : a producer and consumer of a given event?
254+
continue # Skip self to avoid indefinite hanging
253255
self._event_producers[evt].add(comp_id)
254256

255257
async def _update_producer_graph(self) -> None:

0 commit comments

Comments
 (0)