Skip to content

fix(streaming): make ServerSession::CloseNow idempotent on ue5-dev - #9761

Merged
LuisPovedaCano merged 3 commits into
carla-simulator:ue5-devfrom
SunayKulkarni:fix/streaming-serversession-closenow-idempotent-ue5
May 27, 2026
Merged

fix(streaming): make ServerSession::CloseNow idempotent on ue5-dev#9761
LuisPovedaCano merged 3 commits into
carla-simulator:ue5-devfrom
SunayKulkarni:fix/streaming-serversession-closenow-idempotent-ue5

Conversation

@SunayKulkarni

@SunayKulkarni SunayKulkarni commented May 27, 2026

Copy link
Copy Markdown
Contributor

Description

Port of #9740 (ue4-dev) to ue5-dev.

Adds std::atomic_bool _is_closed{false} to ServerSession and guards
CloseNow() with _is_closed.exchange(true) so the close path runs exactly
once, preventing a double-disconnect from evicting a still-alive subscriber
from the world-snapshot stream.

Fixes #9759

Where has this been tested?

Possible Drawbacks

None expected. The change is minimal (~3 lines), platform-independent LibCarla C++, and matches the fix already approved for ue4-dev.


This change is Reviewable

@SunayKulkarni
SunayKulkarni requested a review from a team as a code owner May 27, 2026 10:29
@update-docs

update-docs Bot commented May 27, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

@LuisPovedaCano LuisPovedaCano self-assigned this May 27, 2026

@LuisPovedaCano LuisPovedaCano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This port looks good to me.
Approving to enqueue in CI, but please fix the comment.

# pragma clang diagnostic pop
#endif

#include<atomic>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add and space between the #include and atomic to match the code style fo the rest of the file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure thing

@LuisPovedaCano
LuisPovedaCano merged commit 1aae09e into carla-simulator:ue5-dev May 27, 2026
1 check passed
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.

port(streaming): ServerSession::CloseNow idempotency fix to ue5-dev

2 participants