-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System Console button to manually run a legal hold immediately (#89) #90
base: main
Are you sure you want to change the base?
Conversation
* Pressing this button will fail if the legal hold job is executing at the time it is pressed. * I'm not sure what happens in terms of preventing duplicate runs across a cluster setup - I need to get to the bottom of what kind of protection this plugin has for that eventuality and how it really works. * UI needs some love. * No tests (yet) * No progress indication in the webapp. Potentially mutexing and progress indication could be solved by marking holds as "in progress" in the store, but this means if the job dies/fails for any reason they will be stale and stuck in an a state that will prevent further execution, so this really does need some careful thought.
@grundleborg will you be completing this or should I assign it to someone here? We are planning to release 1.0 early next week - would be great to have this. |
@wiggin77 @jasonblais reviewing the job infrastructure code, this button is robust against simultaneous execution of a legal hold in a single-server Mattermost instance already. However, it is not robust against simultaneous execution in a Mattermost cluster. Does it need to be handle this case? I'm reluctant to add a lot of complexity to the codebase to handle this unless it is absolutely required. As an aside, the cluster job scheduling API in Mattermost Server really needs an additional method for "ignore the usual schedule and run a job right now". Without that we are left reinventing all the cluster-aware locking infrastructure in individual plugins, which is going to be buggy and painful. |
This is now ready to review, subject to the caveat in the above comment about the possibility if multiple simultaneous runs in a cluster environment. Let me know if it is critical to handle the cluster case and I can see what hack I can come up with for it. |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
There is a cluster mutex available. See https://github.com/mattermost/mattermost-plugin-channel-export/blob/3e5043f2a5ddaa67652308330b41f31d29fc5460/server/command_hooks.go#L52 for example usage. |
Potentially mutexing and progress indication could be solved by marking holds as "in progress" in the store, but this means if the job dies/fails for any reason they will be stale and stuck in an a state that will prevent further execution, so this really does need some careful thought.
Suggestions for the UI welcome - see screenshots below.