-
Notifications
You must be signed in to change notification settings - Fork 151
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
PerFrameHandler Framework Issue: Stuck Handler Prevents Execution of Subsequent Handlers #1602
Comments
Solution can be based on my code here: https://pastebin.com/f7LDJxGv |
For example? |
C never runs |
you can add that code and it should catch any failing PFEHs and remove them but this doesn't belong in CBA because it could break things by removing a PFEH that only fails once |
maybe add this as optional |
Code that breaks stuff should not be endorsed, even by being optional. Everything works as expected as is. |
Could we consider making this code more resilient by optionally adding an isNil check (switch in Addons options?)? This would help in scenarios where it's crucial to avoid crashes and ensure continuity of operation, much like landing a satellite on the moon. A failure in one PFH shouldn’t compromise the entire landing operation (high-stakes, high-reliability scenarios). |
I agree with this, as long as it doesn't impact performance. We could error on one PFH and keep running the rest. |
Mods (complete and add to the following information):
N/A
Description:
The perFrameHandler framework in CBA_A3 mod for ArmA 3 is causing a problem where, if one of the perFrameHandlers gets stuck or takes too long to complete, the other handlers in the list do not get called. This results in some event handlers never being executed. https://github.com/CBATeam/CBA_A3/blob/master/addons/common/init_perFrameHandler.sqf
Steps to reproduce:
Launch ArmA 3 with the CBA_A3 mod enabled.
Join a game where perFrameHandler event handlers are used (can be a custom mission or mod scenario that heavily relies on event handlers).
Introduce a perFrameHandler that has a long execution time or gets stuck (e.g., infinite loop).
Observe that other perFrameHandlers do not get executed.
Expected behavior:
Each perFrameHandler should execute independently of the others, so if one is stuck or takes too long, it should not prevent the others from being executed. Not sure how to fix this, maybe by introducing timeouts or at least better info if one of handlers is taking too long.
Where did the issue occur?
Log Files:
N/A
Additional context:
The architecture's current design of iterating through a list to call each handler means that if one gets stuck, the others are prevented from being called. This is particularly problematic in complex scenarios or mods where multiple event handlers are crucial for the mission or gameplay.
Screenshots:
N/A
The text was updated successfully, but these errors were encountered: