Files
ScadaBridge/docs/plans/diagrams/grpc-reconnection-state-machine.drawio
T
Joseph Doherty bdee12f4e9 docs: render architecture & flow diagrams as draw.io charts
Replace ASCII-art diagrams across the README and docs/ with editable
.drawio sources plus exported PNGs, so the diagrams render clearly in
rendered markdown and can be maintained/regenerated instead of being
hand-edited as fragile text art. Non-diagram blocks (code, folder
trees, UI wireframes) were left as text.
2026-05-31 23:32:53 -04:00

84 lines
5.2 KiB
Plaintext

<mxfile host="app.diagrams.net">
<diagram id="statemachine" name="Reconnection State Machine">
<mxGraphModel dx="1000" dy="800" grid="1" gridSize="10" guides="1" arrows="1"
fold="1" page="1" pageScale="1" pageWidth="900" pageHeight="820" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- Streaming state -->
<mxCell id="streaming" value="Streaming" style="rounded=1;arcSize=30;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="360" y="60" width="180" height="60" as="geometry" />
</mxCell>
<mxCell id="streamingNote" value="Normal state:&#10;gRPC stream active" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;fontStyle=2;fontColor=#666666;" vertex="1" parent="1">
<mxGeometry x="560" y="70" width="170" height="40" as="geometry" />
</mxCell>
<!-- Reconnecting state -->
<mxCell id="reconnecting" value="Reconnecting" style="rounded=1;arcSize=30;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="360" y="240" width="180" height="60" as="geometry" />
</mxCell>
<mxCell id="reconnectingNote" value="try other node endpoint" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;fontStyle=2;fontColor=#666666;" vertex="1" parent="1">
<mxGeometry x="560" y="250" width="170" height="40" as="geometry" />
</mxCell>
<!-- Decision diamond -->
<mxCell id="decide" value="reconnect&#10;result?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="380" y="400" width="140" height="90" as="geometry" />
</mxCell>
<!-- Schedule retry box -->
<mxCell id="retry" value="schedule retry&#10;(5s backoff)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=12;" vertex="1" parent="1">
<mxGeometry x="100" y="410" width="170" height="60" as="geometry" />
</mxCell>
<!-- Terminated state -->
<mxCell id="terminated" value="Terminated" style="rounded=1;arcSize=30;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=14;fontStyle=1;" vertex="1" parent="1">
<mxGeometry x="360" y="620" width="180" height="60" as="geometry" />
</mxCell>
<mxCell id="terminatedNote" value="notify consumer,&#10;stop actor" style="text;html=1;align=left;verticalAlign=middle;fontSize=11;fontStyle=2;fontColor=#666666;" vertex="1" parent="1">
<mxGeometry x="560" y="630" width="170" height="40" as="geometry" />
</mxCell>
<!-- Transitions -->
<mxCell id="t_stream_recon" value="gRPC stream error /&#10;keepalive timeout" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;fontSize=11;" edge="1" parent="1" source="streaming" target="reconnecting">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t_recon_decide" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;" edge="1" parent="1" source="reconnecting" target="decide">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- success -> Streaming -->
<mxCell id="t_success" value="success" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;fontSize=11;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="decide" target="streaming">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="700" y="445" />
<mxPoint x="700" y="90" />
</Array>
</mxGeometry>
</mxCell>
<!-- failure (retry < max) -> schedule retry -->
<mxCell id="t_retry" value="failure&#10;(retry &lt; max)" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;fontSize=11;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="decide" target="retry">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- schedule retry -> Reconnecting (loop back) -->
<mxCell id="t_loop" value="" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="retry" target="reconnecting">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="185" y="270" />
</Array>
</mxGeometry>
</mxCell>
<!-- failure (retry >= max) -> Terminated -->
<mxCell id="t_term" value="failure&#10;(retry &gt;= max)" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;rounded=0;fontSize=11;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="decide" target="terminated">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>