opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.22k stars 1.03k forks source link

Batch plan requests get request parameters mixed up #4496

Closed optionsome closed 1 year ago

optionsome commented 2 years ago

Expected behavior

Sending plan requests in a batch query should return itineraries according to the parameters defined in each query.

Observed behavior

Sending plan requests in a batch query causes every query to use parameters from one of the requests.

Version of OTP used (exact commit hash or JAR name)

2.x

Router config and graph build config JSON

Need to enable SandboxAPILegacyGraphQLApi in otp-config.json.

Steps to reproduce the problem

This can be tested through the /otp/routers/<router name>/index/graphql/batch endpoint of the legacy graphQL API by sending two plan queries with different transportModes arguments.

leonardehrenfried commented 1 year ago

@optionsome Our frontend developers have noticed this problem as well and have made it a priority for me to fix.

Could you post everything you already know about the problem?

@derhuerst You have a reproduction case, haven't you? Could you post it here?

cc @hbruch

derhuerst commented 1 year ago

bug.sh:

#!/bin/sh
set -e
set -o pipefail

curl 'https://staging.api.bbnavi.de/otp/routers/default/index/graphql' \
    -H 'authority: staging.api.bbnavi.de' \
    -H 'accept: */*' \
    -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7' \
    -H 'content-type: application/json' \
    -H 'origin: http://localhost:8080' \
    -H 'otptimeout: 12000' \
    -H 'referer: http://localhost:8080/' \
    -H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"' \
    -H 'sec-ch-ua-mobile: ?0' \
    -H 'sec-ch-ua-platform: "macOS"' \
    -H 'sec-fetch-dest: empty' \
    -H 'sec-fetch-mode: cors' \
    -H 'sec-fetch-site: cross-site' \
    -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' \
    --data-raw $'{"id":"SummaryPage_WalkBike_Query","query":"query SummaryPage_WalkBike_Query(\\n  $fromPlace: String\u0021\\n  $toPlace: String\u0021\\n  $intermediatePlaces: [InputCoordinates\u0021]\\n  $date: String\u0021\\n  $time: String\u0021\\n  $walkReluctance: Float\\n  $walkBoardCost: Int\\n  $minTransferTime: Int\\n  $walkSpeed: Float\\n  $bikeAndPublicMaxWalkDistance: Float\\n  $wheelchair: Boolean\\n  $ticketTypes: [String]\\n  $bikeandPublicDisableRemainingWeightHeuristic: Boolean\\n  $arriveBy: Boolean\\n  $transferPenalty: Int\\n  $bikeSpeed: Float\\n  $optimize: OptimizeType\\n  $triangle: InputTriangle\\n  $itineraryFiltering: Float\\n  $unpreferred: InputUnpreferred\\n  $locale: String\\n  $shouldMakeWalkQuery: Boolean\u0021\\n  $shouldMakeBikeQuery: Boolean\u0021\\n  $shouldMakeCarQuery: Boolean\u0021\\n  $shouldMakeParkRideQuery: Boolean\u0021\\n  $shouldMakeOnDemandTaxiQuery: Boolean\u0021\\n  $showBikeAndPublicItineraries: Boolean\u0021\\n  $showBikeAndParkItineraries: Boolean\u0021\\n  $bikeAndPublicModes: [TransportMode\u0021]\\n  $onDemandTaxiModes: [TransportMode\u0021]\\n  $bikeParkModes: [TransportMode\u0021]\\n  $carParkModes: [TransportMode\u0021]\\n  $parkRideModes: [TransportMode\u0021]\\n  $bannedVehicleParkingTags: [String]\\n  $bannedBicycleParkingTags: [String]\\n  $preferredBicycleParkingTags: [String]\\n  $unpreferredBicycleParkingTagPenalty: Float\\n  $useVehicleParkingAvailabilityInformation: Boolean\\n) {\\n  walkPlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, transportModes: [{mode: WALK}], date: $date, time: $time, walkSpeed: $walkSpeed, wheelchair: $wheelchair, arriveBy: $arriveBy, locale: $locale) @include(if: $shouldMakeWalkQuery) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      walkDistance\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        legGeometry {\\n          points\\n        }\\n        distance\\n      }\\n    }\\n  }\\n  bikePlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, transportModes: [{mode: BICYCLE}], date: $date, time: $time, walkSpeed: $walkSpeed, arriveBy: $arriveBy, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, locale: $locale) @include(if: $shouldMakeBikeQuery) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        legGeometry {\\n          points\\n        }\\n        distance\\n      }\\n    }\\n  }\\n  bikeAndPublicPlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, numItineraries: 6, transportModes: $bikeAndPublicModes, date: $date, time: $time, walkReluctance: $walkReluctance, walkBoardCost: $walkBoardCost, minTransferTime: $minTransferTime, walkSpeed: $walkSpeed, maxWalkDistance: $bikeAndPublicMaxWalkDistance, allowedTicketTypes: $ticketTypes, disableRemainingWeightHeuristic: $bikeandPublicDisableRemainingWeightHeuristic, arriveBy: $arriveBy, transferPenalty: $transferPenalty, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, itineraryFiltering: $itineraryFiltering, unpreferred: $unpreferred, locale: $locale) @include(if: $showBikeAndPublicItineraries) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        transitLeg\\n        legGeometry {\\n          points\\n        }\\n        route {\\n          gtfsId\\n          type\\n          shortName\\n          id\\n        }\\n        trip {\\n          gtfsId\\n          directionId\\n          stoptimesForDate {\\n            scheduledDeparture\\n          }\\n          pattern {\\n            ...RouteLine_pattern\\n            id\\n          }\\n          id\\n        }\\n        distance\\n      }\\n    }\\n  }\\n  onDemandTaxiPlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, numItineraries: 6, transportModes: $onDemandTaxiModes, date: $date, time: $time, walkReluctance: $walkReluctance, walkBoardCost: $walkBoardCost, minTransferTime: $minTransferTime, walkSpeed: $walkSpeed, maxWalkDistance: $bikeAndPublicMaxWalkDistance, allowedTicketTypes: $ticketTypes, disableRemainingWeightHeuristic: $bikeandPublicDisableRemainingWeightHeuristic, arriveBy: $arriveBy, transferPenalty: $transferPenalty, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, itineraryFiltering: $itineraryFiltering, unpreferred: $unpreferred, locale: $locale, searchWindow: 10800) @include(if: $shouldMakeOnDemandTaxiQuery) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      ...ItinerarySummaryListContainer_itineraries\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        transitLeg\\n        rentedBike\\n        distance\\n        startTime\\n        endTime\\n        route {\\n          url\\n          mode\\n          shortName\\n          id\\n        }\\n        legGeometry {\\n          points\\n        }\\n        trip {\\n          gtfsId\\n          tripShortName\\n          id\\n        }\\n      }\\n    }\\n  }\\n  bikeParkPlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, numItineraries: 6, transportModes: $bikeParkModes, date: $date, time: $time, walkReluctance: $walkReluctance, walkBoardCost: $walkBoardCost, minTransferTime: $minTransferTime, walkSpeed: $walkSpeed, maxWalkDistance: $bikeAndPublicMaxWalkDistance, allowedTicketTypes: $ticketTypes, disableRemainingWeightHeuristic: $bikeandPublicDisableRemainingWeightHeuristic, arriveBy: $arriveBy, transferPenalty: $transferPenalty, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, itineraryFiltering: $itineraryFiltering, unpreferred: $unpreferred, locale: $locale, bannedVehicleParkingTags: $bannedBicycleParkingTags, preferredVehicleParkingTags: $preferredBicycleParkingTags, unpreferredVehicleParkingTagPenalty: $unpreferredBicycleParkingTagPenalty) @include(if: $showBikeAndParkItineraries) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        transitLeg\\n        legGeometry {\\n          points\\n        }\\n        route {\\n          gtfsId\\n          type\\n          shortName\\n          id\\n        }\\n        trip {\\n          gtfsId\\n          directionId\\n          stoptimesForDate {\\n            scheduledDeparture\\n          }\\n          pattern {\\n            ...RouteLine_pattern\\n            id\\n          }\\n          id\\n        }\\n        to {\\n          bikePark {\\n            bikeParkId\\n            name\\n            id\\n          }\\n        }\\n        distance\\n      }\\n    }\\n  }\\n  carPlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, numItineraries: 5, transportModes: $carParkModes, date: $date, time: $time, walkReluctance: $walkReluctance, walkBoardCost: $walkBoardCost, minTransferTime: $minTransferTime, walkSpeed: $walkSpeed, maxWalkDistance: $bikeAndPublicMaxWalkDistance, allowedTicketTypes: $ticketTypes, arriveBy: $arriveBy, transferPenalty: $transferPenalty, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, itineraryFiltering: $itineraryFiltering, unpreferred: $unpreferred, locale: $locale) @include(if: $shouldMakeCarQuery) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        startTime\\n        mode\\n        ...ItineraryLine_legs\\n        transitLeg\\n        legGeometry {\\n          points\\n        }\\n        route {\\n          gtfsId\\n          type\\n          shortName\\n          id\\n        }\\n        trip {\\n          gtfsId\\n          directionId\\n          stoptimesForDate {\\n            scheduledDeparture\\n          }\\n          pattern {\\n            ...RouteLine_pattern\\n            id\\n          }\\n          id\\n        }\\n        from {\\n          name\\n          lat\\n          lon\\n        }\\n        to {\\n          name\\n          lat\\n          lon\\n          bikePark {\\n            bikeParkId\\n            name\\n            id\\n          }\\n        }\\n        distance\\n      }\\n    }\\n  }\\n  parkRidePlan: plan(fromPlace: $fromPlace, toPlace: $toPlace, intermediatePlaces: $intermediatePlaces, numItineraries: 5, transportModes: $parkRideModes, date: $date, time: $time, walkReluctance: $walkReluctance, walkBoardCost: $walkBoardCost, minTransferTime: $minTransferTime, walkSpeed: $walkSpeed, maxWalkDistance: $bikeAndPublicMaxWalkDistance, allowedTicketTypes: $ticketTypes, arriveBy: $arriveBy, transferPenalty: $transferPenalty, bikeSpeed: $bikeSpeed, optimize: $optimize, triangle: $triangle, itineraryFiltering: $itineraryFiltering, unpreferred: $unpreferred, locale: $locale, useVehicleParkingAvailabilityInformation: $useVehicleParkingAvailabilityInformation, bannedVehicleParkingTags: $bannedVehicleParkingTags) @include(if: $shouldMakeParkRideQuery) {\\n    ...SummaryPlanContainer_plan\\n    ...ItineraryTab_plan\\n    itineraries {\\n      duration\\n      startTime\\n      endTime\\n      ...ItineraryTab_itinerary\\n      ...SummaryPlanContainer_itineraries\\n      legs {\\n        mode\\n        ...ItineraryLine_legs\\n        transitLeg\\n        startTime\\n        legGeometry {\\n          points\\n        }\\n        route {\\n          gtfsId\\n          type\\n          shortName\\n          id\\n        }\\n        trip {\\n          gtfsId\\n          directionId\\n          stoptimesForDate {\\n            scheduledDeparture\\n          }\\n          pattern {\\n            ...RouteLine_pattern\\n            id\\n          }\\n          id\\n        }\\n        to {\\n          carPark {\\n            carParkId\\n            name\\n            id\\n          }\\n          name\\n          lat\\n          lon\\n        }\\n        from {\\n          name\\n          lat\\n          lon\\n        }\\n        distance\\n      }\\n    }\\n  }\\n}\\n\\nfragment ItineraryLine_legs on Leg {\\n  mode\\n  rentedBike\\n  startTime\\n  endTime\\n  distance\\n  legGeometry {\\n    points\\n  }\\n  transitLeg\\n  interlineWithPreviousLeg\\n  route {\\n    shortName\\n    color\\n    type\\n    agency {\\n      name\\n      id\\n    }\\n    id\\n  }\\n  from {\\n    lat\\n    lon\\n    name\\n    vertexType\\n    bikeRentalStation {\\n      lat\\n      lon\\n      stationId\\n      networks\\n      bikesAvailable\\n      id\\n    }\\n    stop {\\n      gtfsId\\n      code\\n      platformCode\\n      id\\n    }\\n  }\\n  to {\\n    lat\\n    lon\\n    name\\n    vertexType\\n    bikeRentalStation {\\n      lat\\n      lon\\n      stationId\\n      networks\\n      bikesAvailable\\n      id\\n    }\\n    stop {\\n      gtfsId\\n      code\\n      platformCode\\n      id\\n    }\\n  }\\n  trip {\\n    gtfsId\\n    stoptimes {\\n      stop {\\n        gtfsId\\n        id\\n      }\\n      pickupType\\n    }\\n    id\\n  }\\n  intermediatePlaces {\\n    arrivalTime\\n    stop {\\n      gtfsId\\n      lat\\n      lon\\n      name\\n      code\\n      platformCode\\n      id\\n    }\\n  }\\n}\\n\\nfragment ItinerarySummaryListContainer_itineraries on Itinerary {\\n  walkDistance\\n  startTime\\n  endTime\\n  legs {\\n    alerts {\\n      alertId\\n      id\\n    }\\n    realTime\\n    departureDelay\\n    realtimeState\\n    transitLeg\\n    startTime\\n    endTime\\n    mode\\n    distance\\n    duration\\n    rentedBike\\n    interlineWithPreviousLeg\\n    intermediatePlace\\n    intermediatePlaces {\\n      stop {\\n        zoneId\\n        id\\n      }\\n    }\\n    route {\\n      mode\\n      shortName\\n      type\\n      color\\n      agency {\\n        name\\n        id\\n      }\\n      alerts {\\n        alertSeverityLevel\\n        effectiveEndDate\\n        effectiveStartDate\\n        entities {\\n          __typename\\n          ... on Route {\\n            patterns {\\n              code\\n              id\\n            }\\n          }\\n          ... on Node {\\n            __isNode: __typename\\n            id\\n          }\\n        }\\n        id\\n      }\\n      id\\n    }\\n    trip {\\n      pattern {\\n        code\\n        id\\n      }\\n      stoptimes {\\n        realtimeState\\n        stop {\\n          gtfsId\\n          id\\n        }\\n        pickupType\\n      }\\n      alerts {\\n        alertSeverityLevel\\n        effectiveEndDate\\n        effectiveStartDate\\n        id\\n      }\\n      id\\n    }\\n    from {\\n      name\\n      lat\\n      lon\\n      stop {\\n        gtfsId\\n        zoneId\\n        platformCode\\n        alerts {\\n          alertSeverityLevel\\n          effectiveEndDate\\n          effectiveStartDate\\n          id\\n        }\\n        id\\n      }\\n      bikeRentalStation {\\n        bikesAvailable\\n        networks\\n        id\\n      }\\n    }\\n    to {\\n      stop {\\n        gtfsId\\n        zoneId\\n        alerts {\\n          alertSeverityLevel\\n          effectiveEndDate\\n          effectiveStartDate\\n          id\\n        }\\n        id\\n      }\\n      bikePark {\\n        bikeParkId\\n        name\\n        id\\n      }\\n      carPark {\\n        carParkId\\n        name\\n        id\\n      }\\n    }\\n  }\\n}\\n\\nfragment ItineraryTab_itinerary on Itinerary {\\n  walkDistance\\n  duration\\n  startTime\\n  endTime\\n  arrivedAtDestinationWithRentedBicycle\\n  fares {\\n    cents\\n    components {\\n      cents\\n      fareId\\n      routes {\\n        agency {\\n          gtfsId\\n          fareUrl\\n          name\\n          id\\n        }\\n        gtfsId\\n        id\\n      }\\n    }\\n    type\\n  }\\n  legs {\\n    mode\\n    alerts {\\n      alertId\\n      alertDescriptionTextTranslations {\\n        language\\n        text\\n      }\\n      id\\n    }\\n    ...LegAgencyInfo_leg\\n    from {\\n      lat\\n      lon\\n      name\\n      vertexType\\n      bikePark {\\n        bikeParkId\\n        name\\n        id\\n      }\\n      bikeRentalStation {\\n        networks\\n        bikesAvailable\\n        lat\\n        lon\\n        stationId\\n        id\\n      }\\n      stop {\\n        gtfsId\\n        code\\n        platformCode\\n        vehicleMode\\n        zoneId\\n        alerts {\\n          alertSeverityLevel\\n          effectiveEndDate\\n          effectiveStartDate\\n          alertHeaderText\\n          alertHeaderTextTranslations {\\n            text\\n            language\\n          }\\n          alertDescriptionText\\n          alertDescriptionTextTranslations {\\n            text\\n            language\\n          }\\n          alertUrl\\n          alertUrlTranslations {\\n            text\\n            language\\n          }\\n          id\\n        }\\n        id\\n      }\\n    }\\n    to {\\n      lat\\n      lon\\n      name\\n      vertexType\\n      bikeRentalStation {\\n        lat\\n        lon\\n        stationId\\n        networks\\n        bikesAvailable\\n        id\\n      }\\n      stop {\\n        gtfsId\\n        code\\n        platformCode\\n        zoneId\\n        name\\n        vehicleMode\\n        alerts {\\n          alertSeverityLevel\\n          effectiveEndDate\\n          effectiveStartDate\\n          alertHeaderText\\n          alertHeaderTextTranslations {\\n            text\\n            language\\n          }\\n          alertDescriptionText\\n          alertDescriptionTextTranslations {\\n            text\\n            language\\n          }\\n          alertUrl\\n          alertUrlTranslations {\\n            text\\n            language\\n          }\\n          id\\n        }\\n        id\\n      }\\n      bikePark {\\n        bikeParkId\\n        name\\n        id\\n      }\\n      carPark {\\n        carParkId\\n        name\\n        id\\n      }\\n      vehicleParkingWithEntrance {\\n        vehicleParking {\\n          tags\\n          id\\n        }\\n      }\\n    }\\n    dropOffBookingInfo {\\n      message\\n      dropOffMessage\\n      contactInfo {\\n        phoneNumber\\n        infoUrl\\n        bookingUrl\\n      }\\n    }\\n    legGeometry {\\n      length\\n      points\\n    }\\n    intermediatePlaces {\\n      arrivalTime\\n      stop {\\n        gtfsId\\n        lat\\n        lon\\n        name\\n        code\\n        platformCode\\n        zoneId\\n        id\\n      }\\n    }\\n    realTime\\n    realtimeState\\n    transitLeg\\n    rentedBike\\n    startTime\\n    endTime\\n    departureDelay\\n    arrivalDelay\\n    interlineWithPreviousLeg\\n    distance\\n    duration\\n    intermediatePlace\\n    route {\\n      shortName\\n      color\\n      gtfsId\\n      type\\n      longName\\n      url\\n      desc\\n      agency {\\n        gtfsId\\n        fareUrl\\n        name\\n        phone\\n        id\\n      }\\n      alerts {\\n        alertSeverityLevel\\n        effectiveEndDate\\n        effectiveStartDate\\n        entities {\\n          __typename\\n          ... on Route {\\n            patterns {\\n              code\\n              id\\n            }\\n          }\\n          ... on Node {\\n            __isNode: __typename\\n            id\\n          }\\n        }\\n        alertHeaderText\\n        alertHeaderTextTranslations {\\n          text\\n          language\\n        }\\n        alertDescriptionText\\n        alertDescriptionTextTranslations {\\n          text\\n          language\\n        }\\n        alertUrl\\n        alertUrlTranslations {\\n          text\\n          language\\n        }\\n        id\\n      }\\n      id\\n    }\\n    trip {\\n      gtfsId\\n      tripHeadsign\\n      pattern {\\n        code\\n        id\\n      }\\n      stoptimesForDate {\\n        headsign\\n        pickupType\\n        realtimeState\\n        stop {\\n          gtfsId\\n          id\\n        }\\n      }\\n      id\\n    }\\n  }\\n}\\n\\nfragment ItineraryTab_plan on Plan {\\n  date\\n}\\n\\nfragment LegAgencyInfo_leg on Leg {\\n  agency {\\n    name\\n    url\\n    fareUrl\\n    id\\n  }\\n}\\n\\nfragment RouteLine_pattern on Pattern {\\n  code\\n  geometry {\\n    lat\\n    lon\\n  }\\n  route {\\n    mode\\n    type\\n    color\\n    id\\n  }\\n  stops {\\n    lat\\n    lon\\n    name\\n    gtfsId\\n    platformCode\\n    code\\n    ...StopCardHeaderContainer_stop\\n    id\\n  }\\n}\\n\\nfragment StopCardHeaderContainer_stop on Stop {\\n  gtfsId\\n  name\\n  code\\n  desc\\n  zoneId\\n  alerts {\\n    alertSeverityLevel\\n    effectiveEndDate\\n    effectiveStartDate\\n    id\\n  }\\n  lat\\n  lon\\n  stops {\\n    name\\n    desc\\n    id\\n  }\\n}\\n\\nfragment SummaryPlanContainer_itineraries on Itinerary {\\n  ...ItinerarySummaryListContainer_itineraries\\n  endTime\\n  startTime\\n  legs {\\n    mode\\n    to {\\n      bikePark {\\n        bikeParkId\\n        name\\n        id\\n      }\\n    }\\n    ...ItineraryLine_legs\\n    transitLeg\\n    legGeometry {\\n      points\\n    }\\n    route {\\n      gtfsId\\n      id\\n    }\\n    trip {\\n      gtfsId\\n      directionId\\n      stoptimesForDate {\\n        scheduledDeparture\\n      }\\n      pattern {\\n        ...RouteLine_pattern\\n        id\\n      }\\n      id\\n    }\\n  }\\n}\\n\\nfragment SummaryPlanContainer_plan on Plan {\\n  date\\n  itineraries {\\n    startTime\\n    endTime\\n    legs {\\n      mode\\n      ...ItineraryLine_legs\\n      transitLeg\\n      legGeometry {\\n        points\\n      }\\n      route {\\n        gtfsId\\n        id\\n      }\\n      trip {\\n        gtfsId\\n        directionId\\n        stoptimesForDate {\\n          scheduledDeparture\\n          pickupType\\n        }\\n        pattern {\\n          ...RouteLine_pattern\\n          id\\n        }\\n        id\\n      }\\n      from {\\n        name\\n        lat\\n        lon\\n        stop {\\n          gtfsId\\n          zoneId\\n          id\\n        }\\n        bikeRentalStation {\\n          bikesAvailable\\n          networks\\n          id\\n        }\\n      }\\n      to {\\n        stop {\\n          gtfsId\\n          zoneId\\n          id\\n        }\\n        bikePark {\\n          bikeParkId\\n          name\\n          id\\n        }\\n      }\\n    }\\n  }\\n}\\n","variables":{"fromPlace":"16278 Angermünde::52.99785880064743,14.016495144704574","toPlace":"Pestalozzistraße 58, 16278 Angermünde::53.01953691083268,13.979673762550846","intermediatePlaces":[],"date":"2022-11-29","time":"16:41:18","walkReluctance":2,"walkBoardCost":600,"minTransferTime":120,"walkSpeed":1.38,"bikeAndPublicMaxWalkDistance":15000,"wheelchair":false,"ticketTypes":null,"bikeandPublicDisableRemainingWeightHeuristic":false,"arriveBy":false,"transferPenalty":0,"bikeSpeed":5.55,"optimize":"TRIANGLE","triangle":{"safetyFactor":0.4,"slopeFactor":0.3,"timeFactor":0.3},"itineraryFiltering":1.5,"unpreferred":null,"locale":"de","shouldMakeWalkQuery":false,"shouldMakeBikeQuery":true,"shouldMakeCarQuery":true,"shouldMakeParkRideQuery":true,"shouldMakeOnDemandTaxiQuery":false,"showBikeAndPublicItineraries":true,"showBikeAndParkItineraries":true,"bikeAndPublicModes":[{"mode":"BICYCLE"},{"mode":"BUS"},{"mode":"CARPOOL"},{"mode":"FERRY"},{"mode":"FLEX","qualifier":"ACCESS"},{"mode":"FLEX","qualifier":"EGRESS"},{"mode":"RAIL"},{"mode":"SUBWAY"},{"mode":"TRAM"}],"onDemandTaxiModes":[{"mode":"FLEX","qualifier":"DIRECT"},{"mode":"FLEX","qualifier":"ACCESS"},{"mode":"FLEX","qualifier":"EGRESS"},{"mode":"BUS"},{"mode":"FLEX","qualifier":"ACCESS"},{"mode":"FLEX","qualifier":"EGRESS"},{"mode":"RAIL"},{"mode":"WALK"}],"bikeParkModes":[{"mode":"BICYCLE","qualifier":"PARK"},{"mode":"BICYCLE","qualifier":"RENT"},{"mode":"BUS"},{"mode":"CARPOOL"},{"mode":"FERRY"},{"mode":"FLEX","qualifier":"ACCESS"},{"mode":"FLEX","qualifier":"EGRESS"},{"mode":"RAIL"},{"mode":"SUBWAY"},{"mode":"TRAM"},{"mode":"WALK"}],"carParkModes":[{"mode":"CAR"}],"parkRideModes":[{"mode":"BUS"},{"mode":"FLEX","qualifier":"ACCESS"},{"mode":"FLEX","qualifier":"EGRESS"},{"mode":"RAIL"},{"mode":"SUBWAY"}],"bannedVehicleParkingTags":["lot_type:Parkplatz","lot_type:Tiefgarage","lot_type:Parkhaus"],"bannedBicycleParkingTags":[],"preferredBicycleParkingTags":[],"unpreferredBicycleParkingTagPenalty":900,"useVehicleParkingAvailabilityInformation":null}}' \
    --compressed -sf`
chmod +x bug.sh
while true; ./bug.sh | jq '.data.carPlan.itineraries[].legs[].mode'; echo \n\n\n\n; sleep 10; end
hannesj commented 1 year ago

I think it might be as a HTTP request only has one org.opentripplanner.standalone.server.DefaultServerRequestContext, it having the routeRequest-field which gets reused by all plan-queries in the same batch query.

leonardehrenfried commented 1 year ago

I think Hannes is onto something. There is this: https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/ext/java/org/opentripplanner/ext/legacygraphqlapi/datafetchers/LegacyGraphQLQueryTypeImpl.java#L590

That looks quite suspicious since it looks like the same routing request is used for the entire batch.

I'm investigating.

leonardehrenfried commented 1 year ago

I can confirm that when you clone the request, the problem goes away.

leonardehrenfried commented 1 year ago

@derhuerst I've also deployed the fix to the bbnavi staging system (production wasn't affected). Can you confirm that it's fixed?

derhuerst commented 1 year ago

Can you confirm that it's fixed?

Seems like it, but I've also just ran the reproduction script so far.