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

[POA-3109] Handle panic while stopping apidump process while daemonset exit #90

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mudit-postman
Copy link
Contributor

This pull request includes changes to prevent the agent from going into a panic state while closing the apidump process during the daemonset process shutdown and other changes.

Problem:

  • Before changing the state of the apidump process to the final state and then calling the StopApiDumpProcess, we are checking if the process is already in the final state to avoid StopApiDumpProcess being called multiple times.
  • But this final state check is not sync, due to which dirty read issue can happen and StopApiDumpProcess can be called multiple times which will send signal to already stopped channel hence causing program to go to panic state.

Changes:

Improvements to state handling:

  • Added a check in changePodTrafficMonitorState to prevent state changes if the pod is already in a final state.
  • Ensure the stop channel is closed only after the API dump process is stopped/exited.
  • Removed redundant checks for end states in various methods, as these are now handled by the new state check in changePodTrafficMonitorState.

Other naming changes:

  • Renamed StopApiDumpProcess to SignalApiDumpProcessToStop for better clarity on its purpose.
  • Renamed isEndState to isTrafficMonitoringInFinalState for better readability and consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant