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

Shutdown Certificate Authority Manager before the stack #527

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

agners
Copy link
Collaborator

@agners agners commented Feb 5, 2024

When shutting down the Certificate Authority Manager, the underlying code needs the chip stack to properly free up all resources. Manually shutdown the Certificate Authority Manager to avoid exception later during shutdown.

This avoids stack traces as follows:

Exception ignored in: <function CertificateAuthorityManager.__del__ at 0x7d523bd51260>
Traceback (most recent call last):
  File "/home/sag/projects/project-chip/python-matter-server/venv/lib/python3.11/site-packages/chip/CertificateAuthority.py", line 306, in __del__
    self.Shutdown()
  File "/home/sag/projects/project-chip/python-matter-server/venv/lib/python3.11/site-packages/chip/CertificateAuthority.py", line 296, in Shutdown
    ca.Shutdown()
  File "/home/sag/projects/project-chip/python-matter-server/venv/lib/python3.11/site-packages/chip/CertificateAuthority.py", line 163, in Shutdown
    self._chipStack.Call(
  File "/home/sag/projects/project-chip/python-matter-server/venv/lib/python3.11/site-packages/chip/ChipStack.py", line 362, in Call
    self.completeEvent.clear()
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'clear'

When shutting down the Certificate Authority Manager, the underlying
code needs the chip stack to properly free up all resources. Manually
shutdown the Certificate Authority Manager to avoid exception later
during shutdown.
@agners agners added the bugfix Pull request that fixes a (known) issue/bug label Feb 5, 2024
@agners agners merged commit bb80054 into main Feb 5, 2024
4 checks passed
@agners agners deleted the fix-server-shutdown branch February 5, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a (known) issue/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants