Add new transaction starting -> error on timeout

Exception along the `starting` inspection code may causes
`no defined transition` error as there is no transition for
`starting` state on timeout event.

Also it could happen if small timeout configured, so there
is not enough time for starting -> waiting transition,
e.g. new greenthread spawn is blocked due to missing of
available slots.

Closes-Bug: #1662494
Change-Id: I66cf0374a2ba4ab4692110daafd4a3d2d20d56d6
This commit is contained in:
Anton Arefiev 2017-02-22 18:56:44 +02:00
parent 67292f1450
commit 9f125629fe
5 changed files with 160 additions and 120 deletions

View File

@ -4,171 +4,177 @@
<!-- Generated by graphviz version 2.36.0 (20140111.2315)
-->
<!-- Title: Ironic Inspector states Pages: 1 -->
<svg width="832pt" height="318pt"
viewBox="0.00 0.00 832.00 318.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 314)">
<svg width="838pt" height="340pt"
viewBox="0.00 0.00 838.00 340.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 336)">
<title>Ironic Inspector states</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-314 828,-314 828,4 -4,4"/>
<polygon fill="white" stroke="none" points="-4,4 -4,-336 834,-336 834,4 -4,4"/>
<!-- enrolling -->
<g id="node1" class="node"><title>enrolling</title>
<ellipse fill="none" stroke="black" cx="34" cy="-251" rx="33.8507" ry="18"/>
<text text-anchor="middle" x="34" y="-248.2" font-family="Times,serif" font-size="11.00" fill="gray">enrolling</text>
</g>
<!-- error -->
<g id="node2" class="node"><title>error</title>
<ellipse fill="none" stroke="black" cx="151" cy="-150" rx="27" ry="18"/>
<text text-anchor="middle" x="151" y="-147.2" font-family="Times,serif" font-size="11.00" fill="red">error</text>
</g>
<!-- enrolling&#45;&gt;error -->
<g id="edge1" class="edge"><title>enrolling&#45;&gt;error</title>
<path fill="none" stroke="black" d="M52.466,-235.66C72.1644,-218.36 104.307,-190.13 126.269,-170.842"/>
<polygon fill="black" stroke="black" points="128.654,-173.405 133.858,-164.177 124.035,-168.146 128.654,-173.405"/>
<text text-anchor="middle" x="96" y="-206" font-family="Times,serif" font-size="10.00" fill="red">error</text>
<ellipse fill="none" stroke="black" cx="34" cy="-223" rx="33.8507" ry="18"/>
<text text-anchor="middle" x="34" y="-220.2" font-family="Times,serif" font-size="11.00" fill="gray">enrolling</text>
</g>
<!-- processing -->
<g id="node3" class="node"><title>processing</title>
<ellipse fill="none" stroke="black" cx="517" cy="-150" rx="38.4712" ry="18"/>
<text text-anchor="middle" x="517" y="-147.2" font-family="Times,serif" font-size="11.00" fill="gray">processing</text>
<g id="node2" class="node"><title>processing</title>
<ellipse fill="none" stroke="black" cx="175" cy="-276" rx="38.4712" ry="18"/>
<text text-anchor="middle" x="175" y="-273.2" font-family="Times,serif" font-size="11.00" fill="gray">processing</text>
</g>
<!-- enrolling&#45;&gt;processing -->
<g id="edge2" class="edge"><title>enrolling&#45;&gt;processing</title>
<path fill="none" stroke="black" d="M55.1347,-265.142C77.3021,-279.301 114.519,-299 150,-299 150,-299 150,-299 381,-299 418.718,-299 432.423,-293.732 460,-268 486.199,-243.553 501.392,-204.325 509.183,-177.88"/>
<polygon fill="black" stroke="black" points="512.599,-178.66 511.903,-168.088 505.854,-176.787 512.599,-178.66"/>
<text text-anchor="middle" x="264" y="-302" font-family="Times,serif" font-size="10.00">process</text>
<g id="edge1" class="edge"><title>enrolling&#45;&gt;processing</title>
<path fill="none" stroke="black" d="M61.8006,-233.219C82.5093,-241.115 111.476,-252.16 134.789,-261.049"/>
<polygon fill="black" stroke="black" points="133.803,-264.419 144.394,-264.711 136.297,-257.878 133.803,-264.419"/>
<text text-anchor="middle" x="102" y="-257" font-family="Times,serif" font-size="10.00">process</text>
</g>
<!-- error&#45;&gt;error -->
<g id="edge3" class="edge"><title>error&#45;&gt;error</title>
<path fill="none" stroke="black" d="M146.146,-167.782C145.322,-177.315 146.939,-186 151,-186 153.474,-186 155.042,-182.775 155.702,-178.098"/>
<polygon fill="black" stroke="black" points="159.206,-177.832 155.854,-167.782 152.207,-177.729 159.206,-177.832"/>
<text text-anchor="middle" x="151" y="-189" font-family="Times,serif" font-size="10.00" fill="red">abort</text>
<!-- error -->
<g id="node3" class="node"><title>error</title>
<ellipse fill="none" stroke="black" cx="297" cy="-157" rx="27" ry="18"/>
<text text-anchor="middle" x="297" y="-154.2" font-family="Times,serif" font-size="11.00" fill="red">error</text>
</g>
<!-- error&#45;&gt;error -->
<g id="edge6" class="edge"><title>error&#45;&gt;error</title>
<path fill="none" stroke="black" d="M143.026,-167.42C138.481,-184.791 141.139,-204 151,-204 158.935,-204 162.206,-191.562 160.813,-177.652"/>
<polygon fill="black" stroke="black" points="164.188,-176.643 158.974,-167.42 157.298,-177.882 164.188,-176.643"/>
<text text-anchor="middle" x="151" y="-207" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- starting -->
<g id="node4" class="node"><title>starting</title>
<ellipse fill="none" stroke="black" cx="264" cy="-140" rx="30.1339" ry="18"/>
<text text-anchor="middle" x="264" y="-137.2" font-family="Times,serif" font-size="11.00" fill="gray">starting</text>
</g>
<!-- error&#45;&gt;starting -->
<g id="edge4" class="edge"><title>error&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M177.86,-148.145C189.52,-147.266 203.459,-146.157 216,-145 218.666,-144.754 221.416,-144.49 224.184,-144.215"/>
<polygon fill="black" stroke="black" points="224.587,-147.693 234.18,-143.195 223.876,-140.729 224.587,-147.693"/>
<text text-anchor="middle" x="206" y="-149" font-family="Times,serif" font-size="10.00">start</text>
</g>
<!-- reapplying -->
<g id="node5" class="node"><title>reapplying</title>
<ellipse fill="none" stroke="black" cx="786" cy="-27" rx="37.7689" ry="18"/>
<text text-anchor="middle" x="786" y="-24.2" font-family="Times,serif" font-size="11.00" fill="gray">reapplying</text>
</g>
<!-- error&#45;&gt;reapplying -->
<g id="edge5" class="edge"><title>error&#45;&gt;reapplying</title>
<path fill="none" stroke="black" d="M160.369,-167.008C176.101,-196.263 213.05,-253 263,-253 263,-253 263,-253 649,-253 740.366,-253 771.925,-115.721 781.403,-55.1474"/>
<polygon fill="black" stroke="black" points="784.887,-55.5155 782.88,-45.1125 777.961,-54.4964 784.887,-55.5155"/>
<text text-anchor="middle" x="444" y="-256" font-family="Times,serif" font-size="10.00">reapply</text>
<!-- enrolling&#45;&gt;error -->
<g id="edge2" class="edge"><title>enrolling&#45;&gt;error</title>
<path fill="none" stroke="black" d="M67.9045,-222.601C111.571,-221.026 190.331,-214.501 252,-189 258.803,-186.187 265.542,-182.121 271.625,-177.825"/>
<polygon fill="black" stroke="black" points="274.138,-180.312 280,-171.487 269.914,-174.731 274.138,-180.312"/>
<text text-anchor="middle" x="175" y="-220" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- processing&#45;&gt;error -->
<g id="edge10" class="edge"><title>processing&#45;&gt;error</title>
<path fill="none" stroke="black" d="M488.02,-162.185C436.942,-182.754 325.428,-219.893 234,-196 213.801,-190.721 193.318,-179.235 177.876,-169.062"/>
<polygon fill="black" stroke="black" points="179.639,-166.028 169.406,-163.281 175.692,-171.81 179.639,-166.028"/>
<text text-anchor="middle" x="322" y="-206" font-family="Times,serif" font-size="10.00" fill="red">error</text>
<g id="edge11" class="edge"><title>processing&#45;&gt;error</title>
<path fill="none" stroke="black" d="M192.685,-259.454C213.838,-238.478 250.369,-202.251 273.842,-178.973"/>
<polygon fill="black" stroke="black" points="276.333,-181.433 280.969,-171.906 271.404,-176.462 276.333,-181.433"/>
<text text-anchor="middle" x="242" y="-223" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- finished -->
<g id="node6" class="node"><title>finished</title>
<ellipse fill="none" stroke="black" cx="648" cy="-77" rx="31.0408" ry="18"/>
<text text-anchor="middle" x="648" y="-74.2" font-family="Times,serif" font-size="11.00" fill="gray">finished</text>
<ellipse fill="none" stroke="black" cx="568" cy="-176" rx="31.0408" ry="18"/>
<text text-anchor="middle" x="568" y="-173.2" font-family="Times,serif" font-size="11.00" fill="gray">finished</text>
</g>
<!-- processing&#45;&gt;finished -->
<g id="edge11" class="edge"><title>processing&#45;&gt;finished</title>
<path fill="none" stroke="black" d="M542.264,-136.269C563.176,-124.435 593.483,-107.285 616.12,-94.4746"/>
<polygon fill="black" stroke="black" points="618.016,-97.4231 624.996,-89.452 614.569,-91.3309 618.016,-97.4231"/>
<text text-anchor="middle" x="586" y="-120" font-family="Times,serif" font-size="10.00">finish</text>
<g id="edge10" class="edge"><title>processing&#45;&gt;finished</title>
<path fill="none" stroke="black" d="M213.09,-278.731C272.125,-281.22 388.862,-278.362 468,-226 480.338,-217.837 474.066,-206.744 486,-198 497.918,-189.268 513.101,-184.002 527.094,-180.826"/>
<polygon fill="black" stroke="black" points="527.879,-184.238 537.009,-178.863 526.519,-177.371 527.879,-184.238"/>
<text text-anchor="middle" x="358" y="-274" font-family="Times,serif" font-size="10.00">finish</text>
</g>
<!-- error&#45;&gt;error -->
<g id="edge5" class="edge"><title>error&#45;&gt;error</title>
<path fill="none" stroke="black" d="M292.146,-174.782C291.322,-184.315 292.939,-193 297,-193 299.474,-193 301.042,-189.775 301.702,-185.098"/>
<polygon fill="black" stroke="black" points="305.206,-184.832 301.854,-174.782 298.207,-184.729 305.206,-184.832"/>
<text text-anchor="middle" x="297" y="-196" font-family="Times,serif" font-size="10.00" fill="red">abort</text>
</g>
<!-- error&#45;&gt;error -->
<g id="edge6" class="edge"><title>error&#45;&gt;error</title>
<path fill="none" stroke="black" d="M289.026,-174.42C284.481,-191.791 287.139,-211 297,-211 304.935,-211 308.206,-198.562 306.813,-184.652"/>
<polygon fill="black" stroke="black" points="310.188,-183.643 304.974,-174.42 303.298,-184.882 310.188,-183.643"/>
<text text-anchor="middle" x="297" y="-214" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- starting -->
<g id="node4" class="node"><title>starting</title>
<ellipse fill="none" stroke="black" cx="684" cy="-176" rx="30.1339" ry="18"/>
<text text-anchor="middle" x="684" y="-173.2" font-family="Times,serif" font-size="11.00" fill="gray">starting</text>
</g>
<!-- error&#45;&gt;starting -->
<g id="edge3" class="edge"><title>error&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M312.309,-171.863C329.454,-188.543 359.908,-214.741 392,-226 479.268,-256.617 511.56,-259.045 600,-232 622.02,-225.266 643.476,-210.507 659.055,-197.83"/>
<polygon fill="black" stroke="black" points="661.685,-200.19 667.071,-191.067 657.171,-194.84 661.685,-200.19"/>
<text text-anchor="middle" x="502" y="-253" font-family="Times,serif" font-size="10.00">start</text>
</g>
<!-- reapplying -->
<g id="node5" class="node"><title>reapplying</title>
<ellipse fill="none" stroke="black" cx="430" cy="-170" rx="37.7689" ry="18"/>
<text text-anchor="middle" x="430" y="-167.2" font-family="Times,serif" font-size="11.00" fill="gray">reapplying</text>
</g>
<!-- error&#45;&gt;reapplying -->
<g id="edge4" class="edge"><title>error&#45;&gt;reapplying</title>
<path fill="none" stroke="black" d="M321.518,-164.6C328.078,-166.394 335.256,-168.057 342,-169 354.867,-170.798 368.908,-171.501 381.882,-171.642"/>
<polygon fill="black" stroke="black" points="382.014,-175.142 392.015,-171.644 382.016,-168.142 382.014,-175.142"/>
<text text-anchor="middle" x="358" y="-175" font-family="Times,serif" font-size="10.00">reapply</text>
</g>
<!-- starting&#45;&gt;error -->
<g id="edge15" class="edge"><title>starting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M236.121,-132.968C223.823,-130.728 209.104,-129.423 196,-132 191.505,-132.884 186.892,-134.23 182.422,-135.798"/>
<polygon fill="black" stroke="black" points="181.011,-132.591 172.968,-139.487 183.556,-139.112 181.011,-132.591"/>
<text text-anchor="middle" x="206" y="-135" font-family="Times,serif" font-size="10.00" fill="red">error</text>
<g id="edge17" class="edge"><title>starting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M658.355,-166.246C642.057,-160.232 620.074,-152.939 600,-149 509.248,-131.191 484.23,-136.169 392,-143 372.651,-144.433 351.243,-147.504 333.751,-150.405"/>
<polygon fill="black" stroke="black" points="332.686,-147.036 323.42,-152.173 333.867,-153.936 332.686,-147.036"/>
<text text-anchor="middle" x="502" y="-141" font-family="Times,serif" font-size="10.00" fill="red">timeout</text>
</g>
<!-- starting&#45;&gt;error -->
<g id="edge18" class="edge"><title>starting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M662.327,-163.45C646.013,-154.197 622.354,-142.186 600,-136 510.901,-111.341 483.632,-121.737 392,-134 369.759,-136.976 363.775,-135.581 342,-141 338.118,-141.966 334.102,-143.152 330.147,-144.438"/>
<polygon fill="black" stroke="black" points="328.852,-141.183 320.554,-147.771 331.149,-147.795 328.852,-141.183"/>
<text text-anchor="middle" x="502" y="-125" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- starting&#45;&gt;starting -->
<g id="edge17" class="edge"><title>starting&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M253.722,-157.037C251.625,-166.858 255.051,-176 264,-176 269.593,-176 273.029,-172.429 274.307,-167.353"/>
<polygon fill="black" stroke="black" points="277.806,-167.027 274.278,-157.037 270.806,-167.047 277.806,-167.027"/>
<text text-anchor="middle" x="264" y="-179" font-family="Times,serif" font-size="10.00">start</text>
<g id="edge15" class="edge"><title>starting&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M674.077,-193.037C672.052,-202.858 675.359,-212 684,-212 689.4,-212 692.718,-208.429 693.952,-203.353"/>
<polygon fill="black" stroke="black" points="697.451,-203.028 693.923,-193.037 690.451,-203.047 697.451,-203.028"/>
<text text-anchor="middle" x="684" y="-215" font-family="Times,serif" font-size="10.00">start</text>
</g>
<!-- waiting -->
<g id="node7" class="node"><title>waiting</title>
<ellipse fill="none" stroke="black" cx="380" cy="-93" rx="30.1339" ry="18"/>
<text text-anchor="middle" x="380" y="-90.2" font-family="Times,serif" font-size="11.00" fill="gray">waiting</text>
<ellipse fill="none" stroke="black" cx="800" cy="-176" rx="30.1339" ry="18"/>
<text text-anchor="middle" x="800" y="-173.2" font-family="Times,serif" font-size="11.00" fill="gray">waiting</text>
</g>
<!-- starting&#45;&gt;waiting -->
<g id="edge16" class="edge"><title>starting&#45;&gt;waiting</title>
<path fill="none" stroke="black" d="M289.176,-130.033C305.5,-123.303 327.271,-114.327 345.291,-106.897"/>
<polygon fill="black" stroke="black" points="346.947,-110.001 354.858,-102.953 344.279,-103.529 346.947,-110.001"/>
<text text-anchor="middle" x="322" y="-122" font-family="Times,serif" font-size="10.00">wait</text>
<path fill="none" stroke="black" d="M709.356,-185.966C722.001,-189.989 737.749,-193.219 752,-191 755.98,-190.38 760.085,-189.482 764.133,-188.428"/>
<polygon fill="black" stroke="black" points="765.356,-191.718 773.978,-185.56 763.398,-184.997 765.356,-191.718"/>
<text text-anchor="middle" x="742" y="-195" font-family="Times,serif" font-size="10.00">wait</text>
</g>
<!-- reapplying&#45;&gt;error -->
<g id="edge12" class="edge"><title>reapplying&#45;&gt;error</title>
<path fill="none" stroke="black" d="M754.017,-17.2524C726.674,-9.51855 685.589,-0 649,-0 263,-0 263,-0 263,-0 202.716,-0 171.423,-79.2538 158.826,-122.545"/>
<polygon fill="black" stroke="black" points="155.447,-121.633 156.152,-132.204 162.194,-123.501 155.447,-121.633"/>
<text text-anchor="middle" x="444" y="-3" font-family="Times,serif" font-size="10.00" fill="red">error</text>
<g id="edge14" class="edge"><title>reapplying&#45;&gt;error</title>
<path fill="none" stroke="black" d="M397.557,-160.564C389.918,-158.671 381.724,-156.968 374,-156 359.888,-154.232 356.221,-155.838 342,-156 339.46,-156.029 336.837,-156.067 334.196,-156.112"/>
<polygon fill="black" stroke="black" points="333.986,-152.615 324.057,-156.31 334.123,-159.614 333.986,-152.615"/>
<text text-anchor="middle" x="358" y="-159" font-family="Times,serif" font-size="10.00" fill="red">error</text>
</g>
<!-- reapplying&#45;&gt;reapplying -->
<g id="edge13" class="edge"><title>reapplying&#45;&gt;reapplying</title>
<path fill="none" stroke="black" d="M773.242,-44.0373C770.638,-53.8579 774.891,-63 786,-63 792.943,-63 797.208,-59.4289 798.795,-54.3529"/>
<polygon fill="black" stroke="black" points="802.294,-54.0248 798.758,-44.0373 795.294,-54.0497 802.294,-54.0248"/>
<text text-anchor="middle" x="786" y="-66" font-family="Times,serif" font-size="10.00">reapply</text>
<g id="edge12" class="edge"><title>reapplying&#45;&gt;reapplying</title>
<path fill="none" stroke="black" d="M417.242,-187.037C414.638,-196.858 418.891,-206 430,-206 436.943,-206 441.208,-202.429 442.795,-197.353"/>
<polygon fill="black" stroke="black" points="446.294,-197.025 442.758,-187.037 439.294,-197.05 446.294,-197.025"/>
<text text-anchor="middle" x="430" y="-209" font-family="Times,serif" font-size="10.00">reapply</text>
</g>
<!-- reapplying&#45;&gt;finished -->
<g id="edge14" class="edge"><title>reapplying&#45;&gt;finished</title>
<path fill="none" stroke="black" d="M748.627,-23.7035C732.542,-23.5857 713.745,-25.3404 698,-32 686.924,-36.6849 676.751,-45.0033 668.58,-53.2245"/>
<polygon fill="black" stroke="black" points="665.926,-50.9381 661.67,-60.6402 671.048,-55.7102 665.926,-50.9381"/>
<text text-anchor="middle" x="714" y="-35" font-family="Times,serif" font-size="10.00">finish</text>
<g id="edge13" class="edge"><title>reapplying&#45;&gt;finished</title>
<path fill="none" stroke="black" d="M463.32,-161.414C479.743,-158.191 499.985,-155.964 518,-159 522.798,-159.809 527.753,-161.033 532.585,-162.462"/>
<polygon fill="black" stroke="black" points="531.65,-165.839 542.243,-165.614 533.822,-159.184 531.65,-165.839"/>
<text text-anchor="middle" x="502" y="-162" font-family="Times,serif" font-size="10.00">finish</text>
</g>
<!-- finished&#45;&gt;starting -->
<g id="edge7" class="edge"><title>finished&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M636.838,-94.1322C622.158,-117.186 592.709,-157.541 556,-177 507.861,-202.518 360.889,-225.049 312,-201 297.23,-193.735 285.796,-179.349 277.906,-166.372"/>
<polygon fill="black" stroke="black" points="280.748,-164.287 272.789,-157.293 274.65,-167.724 280.748,-164.287"/>
<text text-anchor="middle" x="444" y="-211" font-family="Times,serif" font-size="10.00">start</text>
<path fill="none" stroke="black" d="M599.55,-176C613.03,-176 629.046,-176 643.426,-176"/>
<polygon fill="black" stroke="black" points="643.547,-179.5 653.547,-176 643.547,-172.5 643.547,-179.5"/>
<text text-anchor="middle" x="627" y="-179" font-family="Times,serif" font-size="10.00">start</text>
</g>
<!-- finished&#45;&gt;reapplying -->
<g id="edge8" class="edge"><title>finished&#45;&gt;reapplying</title>
<path fill="none" stroke="black" d="M674.901,-67.4777C694.996,-60.0896 723.179,-49.7282 746,-41.3383"/>
<polygon fill="black" stroke="black" points="747.235,-44.6134 755.413,-37.8777 744.819,-38.0434 747.235,-44.6134"/>
<text text-anchor="middle" x="714" y="-60" font-family="Times,serif" font-size="10.00">reapply</text>
<path fill="none" stroke="black" d="M536.608,-175C521.407,-174.468 502.728,-173.766 486,-173 483.316,-172.877 480.559,-172.745 477.777,-172.607"/>
<polygon fill="black" stroke="black" points="477.847,-169.106 467.681,-172.09 477.488,-176.097 477.847,-169.106"/>
<text text-anchor="middle" x="502" y="-178" font-family="Times,serif" font-size="10.00">reapply</text>
</g>
<!-- finished&#45;&gt;finished -->
<g id="edge9" class="edge"><title>finished&#45;&gt;finished</title>
<path fill="none" stroke="black" d="M637.014,-94.0373C634.771,-103.858 638.434,-113 648,-113 653.979,-113 657.652,-109.429 659.018,-104.353"/>
<polygon fill="black" stroke="black" points="662.517,-104.027 658.986,-94.0373 655.517,-104.048 662.517,-104.027"/>
<text text-anchor="middle" x="648" y="-116" font-family="Times,serif" font-size="10.00">finish</text>
</g>
<!-- waiting&#45;&gt;error -->
<g id="edge18" class="edge"><title>waiting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M349.964,-90.9081C320.18,-89.6551 272.844,-90.1631 234,-102 213.818,-108.15 193.335,-120.136 177.889,-130.591"/>
<polygon fill="black" stroke="black" points="175.606,-127.916 169.416,-136.515 179.617,-133.653 175.606,-127.916"/>
<text text-anchor="middle" x="264" y="-105" font-family="Times,serif" font-size="10.00" fill="red">timeout</text>
</g>
<!-- waiting&#45;&gt;error -->
<g id="edge19" class="edge"><title>waiting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M354.203,-83.6922C324.773,-74.0865 274.58,-62.2845 234,-76 207.376,-84.9985 184.362,-107.946 169.549,-125.923"/>
<polygon fill="black" stroke="black" points="166.803,-123.753 163.337,-133.765 172.29,-128.099 166.803,-123.753"/>
<text text-anchor="middle" x="264" y="-79" font-family="Times,serif" font-size="10.00" fill="red">abort</text>
<path fill="none" stroke="black" d="M557.722,-193.037C555.625,-202.858 559.051,-212 568,-212 573.593,-212 577.029,-208.429 578.307,-203.353"/>
<polygon fill="black" stroke="black" points="581.806,-203.027 578.278,-193.037 574.806,-203.047 581.806,-203.027"/>
<text text-anchor="middle" x="568" y="-215" font-family="Times,serif" font-size="10.00">finish</text>
</g>
<!-- waiting&#45;&gt;processing -->
<g id="edge20" class="edge"><title>waiting&#45;&gt;processing</title>
<path fill="none" stroke="black" d="M405.135,-103.19C425.532,-111.803 455.091,-124.283 478.559,-134.191"/>
<polygon fill="black" stroke="black" points="477.298,-137.458 487.872,-138.124 480.021,-131.009 477.298,-137.458"/>
<text text-anchor="middle" x="444" y="-127" font-family="Times,serif" font-size="10.00">process</text>
<g id="edge19" class="edge"><title>waiting&#45;&gt;processing</title>
<path fill="none" stroke="black" d="M794.215,-193.78C782.599,-232.499 749.044,-321 685,-321 296,-321 296,-321 296,-321 264.572,-321 231.293,-307.3 207.773,-295.019"/>
<polygon fill="black" stroke="black" points="209.41,-291.925 198.95,-290.238 206.075,-298.08 209.41,-291.925"/>
<text text-anchor="middle" x="502" y="-324" font-family="Times,serif" font-size="10.00">process</text>
</g>
<!-- waiting&#45;&gt;error -->
<g id="edge21" class="edge"><title>waiting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M792.906,-158.334C779.466,-123.004 743.73,-47 685,-47 429,-47 429,-47 429,-47 376.609,-47 334.216,-99.2371 312.92,-131.716"/>
<polygon fill="black" stroke="black" points="309.881,-129.974 307.482,-140.293 315.793,-133.722 309.881,-129.974"/>
<text text-anchor="middle" x="568" y="-50" font-family="Times,serif" font-size="10.00" fill="red">abort</text>
</g>
<!-- waiting&#45;&gt;error -->
<g id="edge22" class="edge"><title>waiting&#45;&gt;error</title>
<path fill="none" stroke="black" d="M796.115,-157.828C787.838,-112.86 759.631,-0 685,-0 429,-0 429,-0 429,-0 362.169,-0 322.787,-84.9071 306.624,-129.84"/>
<polygon fill="black" stroke="black" points="303.315,-128.701 303.354,-139.295 309.931,-130.989 303.315,-128.701"/>
<text text-anchor="middle" x="568" y="-3" font-family="Times,serif" font-size="10.00" fill="red">timeout</text>
</g>
<!-- waiting&#45;&gt;starting -->
<g id="edge21" class="edge"><title>waiting&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M350.002,-91.1267C337.839,-91.3523 323.808,-92.9812 312,-98 302.03,-102.238 292.742,-109.479 285.1,-116.767"/>
<polygon fill="black" stroke="black" points="282.547,-114.371 278.042,-123.961 287.543,-119.274 282.547,-114.371"/>
<text text-anchor="middle" x="322" y="-101" font-family="Times,serif" font-size="10.00">start</text>
<g id="edge20" class="edge"><title>waiting&#45;&gt;starting</title>
<path fill="none" stroke="black" d="M769.742,-176C756.059,-176 739.556,-176 724.763,-176"/>
<polygon fill="black" stroke="black" points="724.358,-172.5 714.358,-176 724.358,-179.5 724.358,-172.5"/>
<text text-anchor="middle" x="742" y="-179" font-family="Times,serif" font-size="10.00">start</text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -127,6 +127,7 @@ State_space = [
Events.error: States.error,
Events.start: States.starting,
Events.wait: States.waiting,
Events.timeout: States.error
},
},
{

View File

@ -881,6 +881,11 @@ def clean_up():
try:
if node_info.finished_at or node_info.started_at > threshold:
continue
if node_info.state != istate.States.waiting:
LOG.error('Something went wrong, timeout occurs'
'while introspection in "%s" state',
node_info.state,
node_info=node_info)
node_info.fsm_event(istate.Events.timeout)
node_info.finished(error='Introspection timeout')
finally:

View File

@ -376,6 +376,26 @@ class TestNodeCacheCleanUp(test_base.NodeTest):
get_lock_mock.assert_called_once_with(self.uuid)
get_lock_mock.return_value.acquire.assert_called_once_with()
@mock.patch.object(node_cache, '_get_lock', autospec=True)
@mock.patch.object(timeutils, 'utcnow')
def test_timeout_starting(self, time_mock, get_lock_mock):
time_mock.return_value = self.started_at
session = db.get_session()
db.model_query(db.Node, session=session).filter_by(
uuid=self.uuid).update({'state': istate.States.starting})
CONF.set_override('timeout', 1)
current_time = self.started_at + datetime.timedelta(seconds=2)
time_mock.return_value = current_time
self.assertEqual([self.uuid], node_cache.clean_up())
res = [(row.state, row.finished_at, row.error) for row in
db.model_query(db.Node).all()]
self.assertEqual(
[(istate.States.error, current_time, 'Introspection timeout')],
res)
def test_old_status(self):
CONF.set_override('node_status_keep_time', 42)
session = db.get_session()

View File

@ -0,0 +1,8 @@
---
features:
- |
Adds new transition ``starting`` -> ``error`` as reaction on ``timeout``
event.
fixes:
- |
Timeout event on ``starting`` state lead to undefined transition error.