From 01a642c679b7fdfd0dfac253dc654026bbf575a1 Mon Sep 17 00:00:00 2001 From: SunayKulkarni Date: Wed, 27 May 2026 15:55:19 +0530 Subject: [PATCH 1/3] fix(streaming): make ServerSession::CloseNow idempotent on ue5-dev --- LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp | 1 + LibCarla/source/carla/streaming/detail/tcp/ServerSession.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp index e13b12432e6..35f84e361b1 100644 --- a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp +++ b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp @@ -135,6 +135,7 @@ namespace tcp { } void ServerSession::CloseNow(boost::system::error_code ec) { + if (_is_closed.exchange(true)) return; _deadline.cancel(); if (!ec) { diff --git a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h index 017ce56bab2..a8bb96f3cc1 100644 --- a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h +++ b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h @@ -25,6 +25,7 @@ # pragma clang diagnostic pop #endif +#include #include #include @@ -109,6 +110,7 @@ namespace tcp { callback_function_type _on_closed; bool _is_writing = false; + std::atomic_bool _is_closed{false}; }; } // namespace tcp From ba761011bff2ca02b1544712860a00deaf688ac2 Mon Sep 17 00:00:00 2001 From: SunayKulkarni Date: Wed, 27 May 2026 16:01:50 +0530 Subject: [PATCH 2/3] chore: update CHANGELOG for ServerSession::CloseNow idempotency fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f4698183c..5f925571919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ======= ## LATEST Changes +* Fixed ServerSession::CloseNow double-invocation on ue5-dev by guarding with std::atomic_bool _is_closed so the close path runs exactly once, preventing a dropped client from evicting a still-alive subscriber (port of ue4-dev fix #9740) * Added NumPy 2 compatibility to the PythonAPI by upgrading Boost to 1.90.0, which ships the upstream NumPy 2 C ABI fix. LibCarla networking migrated from `boost::asio::deadline_timer` to `boost::asio::steady_timer`, and the deprecated `io_service`, `address::from_string`, `resolver::query`, `buffer_cast`, and `io_context::work` APIs replaced across LibCarla and the CarlaTools plugin. * Added `Vehicle.get_telemetry_data()` returning `VehicleTelemetryData` with last-applied control, forward speed, engine RPM, current gear, and per-wheel lateral slip, longitudinal slip, and angular velocity sourced from the Chaos vehicle physics state. * Added a GeoProjection engine that parses the OpenDRIVE `geoReference` PROJ string into a typed cartographic projection (Transverse Mercator, UTM, Web Mercator, or Lambert Conformal Conic) and exposes it via `Map.get_geoprojection`. `Map.transform_to_geolocation` and `Map.geolocation_to_transform` now accept an optional projection argument together with the new `carla.GeoProjectionTM`/`GeoProjectionUTM`/`GeoProjectionWebMerc`/`GeoProjectionLCC2SP` and `carla.GeoEllipsoid` types, replacing the previous fixed Mercator conversion. From 322a20316c43b54030755b7935e2898732cccbc9 Mon Sep 17 00:00:00 2001 From: SunayKulkarni Date: Wed, 27 May 2026 16:33:53 +0530 Subject: [PATCH 3/3] added spacing in header section --- LibCarla/source/carla/streaming/detail/tcp/ServerSession.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h index a8bb96f3cc1..5162ba73eef 100644 --- a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h +++ b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.h @@ -25,7 +25,7 @@ # pragma clang diagnostic pop #endif -#include +#include #include #include