Skip to content

Uploader task is inadvertently restarted on each log write #157

Description

@gregomite

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions