Fix Initialization in AcknowledgePossession, possible race condition #78
No reviewers
Labels
No labels
breaking
effort
1
effort
13
effort
2
effort
3
effort
5
effort
8
good first issue
help
priority
2day
priority
now
priority
soon
state
approved
state
blocked
state
inactive
state
pending
type
bug
type
chore
type
discussion
type
docs
type
feature
type
fix
type
security
type
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lucastucious/GASDocumentation!78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "linqen/patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After a lot of debugging, I found that there is a possible race condition during bad network conditions (~200ms, 5% packet loss) with 5%~10% of repro chances.
If this happens, ASC will not be initialized properly and you will get
LogAbilitySystem: Warning: Can't activate LocalOnly or LocalPredicted ability %s when not local!This happens because during
AcknowledgePossession, the pawn controller is not setup yet, and duringFGameplayAbilityActorInfo::InitFromActor,PlayerControllerwill be null forever, and then, when callingUAbilitySystemComponent::InternalTryActivateAbility,bool bIsLocal = AbilityActorInfo->IsLocallyControlled()will be falseI consider that
OnRep_Pawnis a good place to callRefreshAbilityActorInfo, that will callFGameplayAbilityActorInfo::InitFromActoragain, but the controller will be valid at that point.@tranek this issue is still reproduceable, and following the documentation examples will end in this issue sooner or later in any networked game.
If there is a way I can help you to repro this, and waste less time, let me know.
@linqen Is it reproducible yet?
It is using UE 5.0. I don't have much free time right now, so I can't confirm on newer versions.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.