-
Notifications
You must be signed in to change notification settings - Fork 87
Clarify static lock ownership for vehicles-for-agency and conformance tests #795
Copy link
Copy link
Open
Description
Summary
Static GTFS lock ownership around vehicles-for-agency was inconsistent, and some tests were calling static manager accessors without the caller-held RLock() they require.
Problem
vehiclesForAgencyHandler previously acquired GtfsManager.RLock() only for the initial FindAgency lookup and released it before continuing with the rest of the handler. VehiclesForAgencyID separately acquired the static lock internally.
That split lock ownership made the static read boundary unclear and inconsistent with the rest of the gtfs.Manager API, where static accessors generally expect the caller to already hold RLock().
Tests had the same issue:
- Direct calls to
VehiclesForAgencyIDdid not consistently holdRLock() TestOpenAPIConformance_StaticEndpointswas reading static manager data without first acquiringRLock()
Expected Behavior
Static manager access should follow one consistent contract:
- Caller holds
manager.RLock() - Static accessor reads happen within that caller-owned lock scope
Issue Solved
vehicles-for-agencynow uses one explicit caller-owned static read-lock scopeVehiclesForAgencyIDnow follows the same caller-locking contract as other static manager accessors- Missing
RLock()coverage was added toTestOpenAPIConformance_StaticEndpoints
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels