Anyone encountered the message queue getting out of sequence (at least in the Python toolbox results window) on a large process? I'm running a long Python process -- looping through ~300,000 rows -- and getting messages (used for debugging) that are clearly out of sequence. Or, I've completely lost sight of how Python loops work.
Any insights?
Eric
The message window (near the end of the process):

The Python loop:
<SPAN class="comment token"># loop through all parcels</SPAN>
sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"PropertyID IS NOT NULL"</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>parcel_fc<SPAN class="punctuation token">,</SPAN>parcel_fields<SPAN class="punctuation token">,</SPAN>sql<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
i <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
propertyID <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"PropertyID = "</SPAN><SPAN class="operator token">+</SPAN>str<SPAN class="punctuation token">(</SPAN>propertyID<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"SQL = "</SPAN><SPAN class="operator token">+</SPAN>sql<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># select related records in deeds table, take only 1st result</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>deed_tbl<SPAN class="punctuation token">,</SPAN>deed_fields<SPAN class="punctuation token">,</SPAN>sql<SPAN class="punctuation token">,</SPAN>sql_clause<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"TOP 1"</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">"ORDER BY DeedDate DESC"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor2<SPAN class="punctuation token">:</SPAN>
j <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">for</SPAN> row2 <SPAN class="keyword token">in</SPAN> cursor2<SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"DeedID = "</SPAN><SPAN class="operator token">+</SPAN>str<SPAN class="punctuation token">(</SPAN>row2<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN><SPAN class="string token">", DeedDate = "</SPAN><SPAN class="operator token">+</SPAN>str<SPAN class="punctuation token">(</SPAN>row2<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> row2<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> row2<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> row2<SPAN class="punctuation token">[</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN>
cursor<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">)</SPAN>
j <SPAN class="operator token">+=</SPAN> <SPAN class="number token">1</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Rows found = "</SPAN><SPAN class="operator token">+</SPAN>str<SPAN class="punctuation token">(</SPAN>j<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> j <SPAN class="operator token">></SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Found more than one deed"</SPAN><SPAN class="punctuation token">)</SPAN>
sys<SPAN class="punctuation token">.</SPAN>exit<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
i <SPAN class="operator token">+=</SPAN> <SPAN class="number token">1</SPAN>
<SPAN class="comment token">#if i > 1000:</SPAN>
<SPAN class="comment token"># arcpy.AddMessage("Rows updated ="+str(i))</SPAN>
<SPAN class="comment token"># sys.exit(0)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Rows updated ="</SPAN><SPAN class="operator token">+</SPAN>str<SPAN class="punctuation token">(</SPAN>i<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"AddLatestDeed.py finished"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>