Event feed API endpoint may return duplicate entries #837
Labels
bug
Something isn't working
high priority
Bugs that are high priority (to fix)
Primary CCS
Required for PC2 to act as primary CCS
Milestone
Describe the issue:
When requesting the event feed using the
contest/event-feed
API endpoint, duplicate events may be sent in the returned stream.To Reproduce:
To duplicate this issue, there are several prerequisites (we will use the "submissions" data records for this example):
Assuming both 1 and 2 are satisfied, a new connection on the event-feed endpoint will see every submission that was made duplicated
N
times whereN = NC-1
, whereNC
= number of event-feed consumers that were connected when the submissions were made.Expected behavior:
Events should not be duplicated on the event-feed when a new consumer connects.
Actual behavior:
Duplicate events may be returned when a new consumer requests the event-feed API endpoint.
Environment:
All.
Log Info:
Screenshots:
N/A
Additional context:
Basically, for every client consuming the event feed, an entry is added to the
EventfeedLog_Default--XXXXXXXXXX.log
file for each event that is generated while said consumers are connected. This causes multiple copies of the same event to be put into the saved event feed log file:EventfeedLog_Default--XXXXXXXXXX.log
When a new event-feed consumer connects, PC2 reads theEventfeedLog_Default--XXXXXXXXXX.log
file and sends that to the new consumer. The file contains the duplicate entries. (See attached file). It seems, inEventFeedSTreamer.sendJSON()
, theeventFeedLog.writeEvent(string)
is called for each instance of the streamer.sendJSON()
is called (for eachRunListener
, and there is aRunLIstener
for each connected consumer).To obtain a correct event feed, use the report generator from an Admin or the Server GUI. The Event Feed client's View Event Feed button uses the
EventFeedLog
, and, as a result, will have duplicate entries as described above, whereas the report generator completely regenerates the event feed based on internal data structures.EventfeedLog_Default-Excerpt.log
The text was updated successfully, but these errors were encountered: