PR #154 introduced 2 critical regressions.
-
Uploader task is restarted on every log write in LogsAgent: In LogsAgent.datadogroku_ensureUploader() (line 210), the newly added uploader.control = "RUN" is unconditional. datadogroku_ensureUploader() is called from datadogroku_ensureSetup(), which is called at the top of every datadogroku_sendLog() invocation. Every call to logOk, logInfo, logError, etc. will therefore restart the datadogroku_uploaderLoop task, aborting any active upload and resetting the loop from the beginning.
-
A similar case exists in RumAgent. The Uploader task restarted on every RUM event due to unconditional control = "RUN": In RumAgent.datadogroku_ensureUploader() (line 486), m.uploader.control = "RUN" is now set unconditionally — outside the if (m.uploader = invalid) guard. This function is called from datadogroku_ensureSetup() which is invoked for every __on* handler (startView, addAction, addError, addResource, etc.). In Roku's SceneGraph, assigning "RUN" to a Task's control field always triggers (re-)execution of the task function; if the task is already running, it is restarted from the top of the loop. The result is that the datadogroku_uploaderLoop is restarted on every processed RUM event, so any in-progress upload is aborted and the loop resets, making it practically impossible for files to upload.
PR #154 introduced 2 critical regressions.
Uploader task is restarted on every log write in LogsAgent: In LogsAgent.datadogroku_ensureUploader() (line 210), the newly added uploader.control = "RUN" is unconditional.
datadogroku_ensureUploader()is called fromdatadogroku_ensureSetup(), which is called at the top of everydatadogroku_sendLog()invocation. Every call to logOk, logInfo, logError, etc. will therefore restart thedatadogroku_uploaderLooptask, aborting any active upload and resetting the loop from the beginning.A similar case exists in RumAgent. The Uploader task restarted on every RUM event due to unconditional control = "RUN": In
RumAgent.datadogroku_ensureUploader()(line 486),m.uploader.control = "RUN"is now set unconditionally — outside theif (m.uploader = invalid)guard. This function is called fromdatadogroku_ensureSetup()which is invoked for every __on* handler (startView, addAction, addError, addResource, etc.). In Roku's SceneGraph, assigning "RUN" to a Task's control field always triggers (re-)execution of the task function; if the task is already running, it is restarted from the top of the loop. The result is that thedatadogroku_uploaderLoopis restarted on every processed RUM event, so any in-progress upload is aborted and the loop resets, making it practically impossible for files to upload.