Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Fix client substrate lost connection and dependencies #334

Merged
merged 10 commits into from
Dec 1, 2021

Conversation

fewensa
Copy link
Contributor

@fewensa fewensa commented Nov 30, 2021

Fix connection lost error

[2021-11-30T06:13:46Z ERROR component_pangoro_s2s::feemarket] [Pangoro] Failed to query order: The background task been terminated because: Networking or low-level protocol error: WebSocket connection error: 0; restart required

    Caused by:
        The background task been terminated because: Networking or low-level protocol error: WebSocket connection error: 0; restart required

    Stack backtrace:
       0: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       1: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       2: messages_relay::message_race_delivery::run::{{closure}}
       3: messages_relay::message_lane_loop::run_until_connection_lost::{{closure}}::{{closure}}::{{closure}}
       4: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
       5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       7: async_task::raw::RawTask<F,T,S>::run
       8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
      10: async_io::driver::block_on
      11: std::thread::local::LocalKey<T>::with
      12: async_global_executor::threading::thread_main_loop
      13: std::sys_common::backtrace::__rust_begin_short_backtrace
      14: core::ops::function::FnOnce::call_once{{vtable.shim}}
      15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                 at ./rustc/db9d361a4731ca0bb48533fab6297a8fea75696f/library/alloc/src/boxed.rs:1694:9
      16: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                 at ./rustc/db9d361a4731ca0bb48533fab6297a8fea75696f/library/alloc/src/boxed.rs:1694:9
      17: std::sys::unix::thread::Thread::new::thread_start
                 at ./rustc/db9d361a4731ca0bb48533fab6297a8fea75696f/library/std/src/sys/unix/thread.rs:108:17
      18: start_thread
      19: clone

But now it's not a good solution. because there it's create a new client and reconnect anyway. there is no better solution currently.

The reason is reconnect is a mut function. but the RelayStrategy::decide isn't.

Related:

@hackfisher

This comment has been minimized.

@fewensa

This comment has been minimized.

@fewensa fewensa marked this pull request as draft December 1, 2021 06:41
fewensa and others added 3 commits December 1, 2021 15:55
* Update dependencies

* Fix package

* Update dependencies

* Update dependencies

* fix compile

* Clippy
@fewensa fewensa marked this pull request as ready for review December 1, 2021 10:13
@fewensa fewensa changed the title Get a client that is always available Fix client substrate lost connection and dependencies Dec 1, 2021
@hackfisher hackfisher merged commit b62f322 into master Dec 1, 2021
@hackfisher hackfisher deleted the fix-pangolin-pangoro branch December 1, 2021 10:14
@fewensa
Copy link
Contributor Author

fewensa commented Dec 1, 2021

   Compiling component-pangoro-s2s v0.4.8 (D:\dev\darwinia-network\bridger\components\client-pangoro-s2s)
   Compiling component-crab-s2s v0.4.8 (D:\dev\darwinia-network\bridger\components\client-crab-s2s)
   Compiling component-darwinia-s2s v0.4.8 (D:\dev\darwinia-network\bridger\components\client-darwinia-s2s)
   Compiling task-darwinia-crab v0.4.8 (D:\dev\darwinia-network\bridger\task\task-darwinia-crab)
   Compiling component-pangolin-s2s v0.4.8 (D:\dev\darwinia-network\bridger\components\client-pangolin-s2s)
   Compiling task-pangolin-pangoro v0.4.8 (D:\dev\darwinia-network\bridger\task\task-pangolin-pangoro)
   Compiling darwinia-bridger v0.4.8 (D:\dev\darwinia-network\bridger\bin)
    Finished dev [unoptimized + debuginfo] target(s) in 6m 36s

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants