Skip to content

RemoveContentCommand executor is not thread-safe #733

Description

@Marcono1234

The Bug

RemoveContentCommand uses a separate new thread as executor:

It appears this is not thread-safe, mainly due to the issue.addRawRestrictedComment call which accesses the helper messages which are mutable and might be updated during regular execution.
Maybe there are also other parts which are not thread-safe; and even if that is not the case it is pretty error-prone.

Expected behavior

Not sure. I assume when #512 added the command the separate executor thread was used since content removal might be time intensive. We should probably check whether that is actually a problem. Having a separate executor thread would likely also make fixing #527 (respectively performing the necessary refactoring) more difficult.

Maybe we can use the normal execution thread for the content removal and, if necessary, adjust IssueUpdateContextCache#applyChanges (or its successor) to perform pauses when processing a large amount of updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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