File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 109
109
}
110
110
111
111
// now that we have loaded the records, check for redos and handle them
112
- while ( engine . CountRedoRecords ( ) > 0 )
112
+ for ( string redo = engine . GetRedoRecord ( ) ;
113
+ redo != null ;
114
+ redo = engine . GetRedoRecord ( ) )
113
115
{
114
- // get the next redo record
115
- string redo = engine . GetRedoRecord ( ) ;
116
-
117
116
try
118
117
{
119
118
// process the redo record
Original file line number Diff line number Diff line change @@ -116,6 +116,9 @@ TaskScheduler taskScheduler
116
116
} while ( pendingFutures . Count >= MaximumBacklog ) ;
117
117
118
118
// check if there are no redo records right now
119
+ // NOTE: we do NOT want to call countRedoRecords() in a loop that
120
+ // is processing redo records, we call it here AFTER we believe
121
+ // have processed all pending redos to confirm still zero
119
122
if ( engine . CountRedoRecords ( ) == 0 )
120
123
{
121
124
OutputRedoStatistics ( ) ;
Original file line number Diff line number Diff line change @@ -98,10 +98,10 @@ public static void main(String[] args) {
98
98
}
99
99
100
100
// now that we have loaded the records, check for redos and handle them
101
- while ( engine .countRedoRecords () > 0 ) {
102
- // get the next redo record
103
- String redo = engine .getRedoRecord ();
104
-
101
+ for ( String redo = engine .getRedoRecord ();
102
+ redo != null ;
103
+ redo = engine .getRedoRecord ())
104
+ {
105
105
try {
106
106
// process the redo record
107
107
engine .processRedoRecord (redo , SZ_NO_FLAGS );
Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ public static void main(String[] args) {
103
103
} while (pendingFutures .size () >= MAXIMUM_BACKLOG );
104
104
105
105
// check if there are no redo records right now
106
+ // NOTE: we do NOT want to call countRedoRecords() in a loop that
107
+ // is processing redo records, we call it here AFTER we believe
108
+ // have processed all pending redos to confirm still zero
106
109
if (engine .countRedoRecords () == 0 ) {
107
110
outputRedoStatistics ();
108
111
System .out .println ();
You can’t perform that action at this time.
0 commit comments