Skip to content
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

Dispose modules during onLoad if parent is unloaded/unloading #243

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

dustyholmes-wf
Copy link
Contributor

@dustyholmes-wf dustyholmes-wf commented Mar 1, 2024

Motivation

When a child module is loaded, it is possible for the unload of the parent to complete before the onWillLoadChildModule handler executes.

This is a second attempt at a safe implementation of #239.

Changes

Check unloading/unloaded and just dispose in that handler instead.

Release Notes

Fix bug where child module loads during the unload of the parent causing Bad State exceptions.

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Architecture member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

This is a safety mechanism because the disposal of a module will remove parts of its disposables which will cause the disposal of children to explode on unload.
@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@dustyholmes-wf dustyholmes-wf changed the title Unload modules before disposal Dispose modules during onLoad if parent is unloaded/unloading Mar 4, 2024
@dustyholmes-wf
Copy link
Contributor Author

Testing this against DPC to verify I'm not causing some new timing problem to surface, as I did last time.

https://github.com/Workiva/doc_plat_client/compare/test_consume_workiva/w_module-unload-modules-before-dispose?expand=1

Copy link
Member

@todbachman-wf todbachman-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10
@Workiva/release-management-pp

Copy link
Contributor

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from RM

@rmconsole7-wk rmconsole7-wk merged commit f9d8858 into master Mar 4, 2024
7 checks passed
@rmconsole7-wk rmconsole7-wk deleted the unload-modules-before-dispose branch March 4, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants