OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
GNU Lesser General Public License v3.0
435 stars 40 forks source link

when running editoast with `NO_CACHE=true`, pathfinding requests fail #8102

Closed eckter closed 1 month ago

eckter commented 1 month ago

What happened?

When running editoast with the environment variable NO_CACHE=true, all pathfinding requests fail (before even reaching core). It results inFailed to connect to host: Internal error: connector has been disconnected`

editoast logs ``` called `Option::unwrap()` on a `None` value stack backtrace: 0: rust_begin_unwind at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5 1: core::panicking::panic_fmt at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14 2: core::panicking::panic at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:146:5 3: core::option::unwrap_failed at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:1984:5 4: core::option::Option::unwrap at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:932:21 5: editoast::views::v2::path::pathfinding::pathfinding_blocks::{{closure}} at ./src/views/v2/path/pathfinding.rs:104:8 6: ::register::post::{{closure}} at ./src/views/v2/path/pathfinding.rs:91:77 7: actix_web::handler::handler_service::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.8.0/src/handler.rs:113:22 8: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 9: as actix_web::service::HttpServiceFactory>::register::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.8.0/src/resource.rs:452:28 10: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 11: as actix_web::service::HttpServiceFactory>::register::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.8.0/src/scope.rs:429:28 12: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 13: as actix_web::service::HttpServiceFactory>::register::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.8.0/src/scope.rs:429:28 14: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 15: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry-0.23.0/src/trace/context.rs:382:9 16: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/future/map.rs:55:37 17: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:91:13 18: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 19: as actix_service::Service>::call::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-cors-0.7.0/src/middleware.rs:239:27 20: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 21: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.8.0/src/middleware/logger.rs:361:32 22: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-service-2.0.2/src/map_err.rs:99:9 23: actix_http::h1::dispatcher::InnerDispatcher::poll_response at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-http-3.8.0/src/h1/dispatcher.rs:466:27 24: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-http-3.8.0/src/h1/dispatcher.rs:1128:43 25: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-http-3.8.0/src/service.rs:1052:45 26: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-service-2.0.2/src/and_then.rs:114:37 27: as actix_service::Service<(actix_server::worker::WorkerCounterGuard,actix_server::socket::MioStream)>>::call::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.4.0/src/service.rs:75:31 28: tokio::runtime::task::core::Core::poll::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/core.rs:328:17 29: tokio::loom::std::unsafe_cell::UnsafeCell::with_mut at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/loom/std/unsafe_cell.rs:16:9 30: tokio::runtime::task::core::Core::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/core.rs:317:13 31: tokio::runtime::task::harness::poll_future::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/harness.rs:485:19 32: as core::ops::function::FnOnce<()>>::call_once at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panic/unwind_safe.rs:272:9 33: std::panicking::try::do_call at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:559:40 34: __rust_try 35: std::panicking::try at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:523:19 36: std::panic::catch_unwind at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panic.rs:149:14 37: tokio::runtime::task::harness::poll_future at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/harness.rs:473:18 38: tokio::runtime::task::harness::Harness::poll_inner at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/harness.rs:208:27 39: tokio::runtime::task::harness::Harness::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/harness.rs:153:15 40: tokio::runtime::task::raw::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/raw.rs:271:5 41: tokio::runtime::task::raw::RawTask::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/raw.rs:201:18 42: tokio::runtime::task::LocalNotified::run at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/task/mod.rs:427:9 43: tokio::task::local::LocalSet::tick::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:676:63 44: tokio::runtime::coop::with_budget at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/coop.rs:107:5 45: tokio::runtime::coop::budget at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/coop.rs:73:5 46: tokio::task::local::LocalSet::tick at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:676:31 47: as core::future::future::Future>::poll::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:982:16 48: tokio::task::local::LocalSet::with::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:730:13 49: std::thread::local::LocalKey::try_with at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/local.rs:286:12 50: std::thread::local::LocalKey::with at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/local.rs:262:9 51: tokio::task::local::LocalSet::with at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:728:9 52: as core::future::future::Future>::poll at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:968:9 53: tokio::task::local::LocalSet::run_until::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/task/local.rs:635:19 54: as core::future::future::Future>::poll at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/future/future.rs:123:9 55: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:659:57 56: tokio::runtime::coop::with_budget at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/coop.rs:107:5 57: tokio::runtime::coop::budget at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/coop.rs:73:5 58: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:659:25 59: tokio::runtime::scheduler::current_thread::Context::enter at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:404:19 60: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:658:36 61: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:737:68 62: tokio::runtime::context::scoped::Scoped::set at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/context/scoped.rs:40:9 63: tokio::runtime::context::set_scheduler::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/context.rs:180:26 64: std::thread::local::LocalKey::try_with at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/local.rs:286:12 65: std::thread::local::LocalKey::with at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/local.rs:262:9 66: tokio::runtime::context::set_scheduler at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/context.rs:180:9 67: tokio::runtime::scheduler::current_thread::CoreGuard::enter at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:737:27 68: tokio::runtime::scheduler::current_thread::CoreGuard::block_on at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:646:19 69: tokio::runtime::scheduler::current_thread::CurrentThread::block_on::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:175:28 70: tokio::runtime::context::runtime::enter_runtime at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/context/runtime.rs:65:16 71: tokio::runtime::scheduler::current_thread::CurrentThread::block_on at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/scheduler/current_thread/mod.rs:167:9 72: tokio::runtime::runtime::Runtime::block_on at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.1/src/runtime/runtime.rs:347:47 73: actix_server::worker::ServerWorker::start::{{closure}} at /home/eckter/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.4.0/src/worker.rs:406:29 ```

What did you expect to happen?

No response

How can we reproduce it (as minimally and precisely as possible)?

  1. Launch editoast without cache (env NO_CACHE=true)
  2. Try any pathfinding request that would normally work out (using TS v2)

On which environments the bug occurs?

Local

On which browser the bug occurs?

Firefox, Other

OSRD version (top right corner Account button > Informations)

064f4241f560435e0ea2dbbc9b36b797b84fdb05

woshilapin commented 1 month ago

I opened #8139 to fix it. It changed a bunch of the implementation for --no-cache. I hope it should give better hints when something does not work about "this is not implemented, please contact the editoast team".

woshilapin commented 1 month ago

@eckter PR has been merged, so the ticket automatically closed. Tell me if it works for you.

eckter commented 1 month ago

It works, thanks for the quick fix :ok_hand: