java/com.sap.sailing.server.trackfiles.test/src/com/sap/sailing/server/trackfiles/test/JumpyTrackSmootheningTest.java
... ...
@@ -228,7 +228,8 @@ public class JumpyTrackSmootheningTest {
228 228
}
229 229
230 230
/**
231
- * Simulates the "Oak cliff DH Distance Race" R1 with a single competitor, Gallagher / Zelenka, sail number "1" with
231
+ * Simulates the "Oak cliff DH Distance Race" R1 (see https://my.sapsailing.com/gwt/RaceBoard.html?regattaName=Oak+cliff+DH+Distance+Race&raceName=R1&leaderboardName=Oak+cliff+DH+Distance+Race&leaderboardGroupId=a3902560-6bfa-43be-85e1-2b82a4963416&eventId=bf48a59d-f2af-47b6-a2f7-a5b78b22b9f2)
232
+ * with a single competitor, Gallagher / Zelenka, sail number "1" with
232 233
* the marks pinged statically to establish the course. The track of Gallagher / Zelenka is provided as a track of
233 234
* their GPS positions. This could be the raw track, or it may be a filtered variant of the track with outliers
234 235
* removed or adjusted.<p>
... ...
@@ -288,7 +289,7 @@ public class JumpyTrackSmootheningTest {
288 289
addFixedMarkPassingToRaceLog("2020-10-14T17:29:36Z", gallagherZelenka, 2, raceLog);
289 290
addFixedMarkPassingToRaceLog("2020-10-14T17:36:42Z", gallagherZelenka, 3, raceLog);
290 291
addFixedMarkPassingToRaceLog("2020-10-14T18:21:38Z", gallagherZelenka, 4, raceLog);
291
- trackedRace.setStatus(new TrackedRaceStatusImpl(TrackedRaceStatusEnum.LOADING, 0.0));
292
+ trackedRace.setStatus(new TrackedRaceStatusImpl(TrackedRaceStatusEnum.LOADING, 0.0)); // suspends mark passing calculator
292 293
final DynamicGPSFixTrack<Competitor, GPSFixMoving> competitorTrackInRace = trackedRace.getTrack(gallagherZelenka);
293 294
// TODO switch race into suspended mode to avoid updates during mass fix insertion:
294 295
competitorTrack.lockForRead();
... ...
@@ -299,8 +300,12 @@ public class JumpyTrackSmootheningTest {
299 300
} finally {
300 301
competitorTrack.unlockAfterRead();
301 302
}
302
- trackedRace.setStatus(new TrackedRaceStatusImpl(TrackedRaceStatusEnum.TRACKING, 1.0));
303
- // TODO resume race
303
+ trackedRace.setStatus(new TrackedRaceStatusImpl(TrackedRaceStatusEnum.TRACKING, 1.0)); // resumes mark passing calculator
304
+ // FIXME is it possible that MarkPassingCalculator.Listen has applied only a subset of the changes from its queue when this method returns?
305
+ // It scoops up a few events from the queue under the MPC write lock and collects the changes in various collections, but doesn't re-calculate while suspended;
306
+ // When the lock is released prior to fetching the next set of events from the queue, the test case calling this method may call getMarkPassings(..., true)
307
+ // and obtain the read lock, keeping the Listen thread from applying the next round of updates. Yes, the getMarkPassings(...) call may return something,
308
+ // but that may be the result of only applying a subset of the changes, with other changes still in the queue...
304 309
return trackedRace;
305 310
}
306 311