Implement Postgres connection pooling
ayrat555 opened this issue · 0 comments
ayrat555 commented
BadConnection("FATAL: sorry, too many clients already\nFATAL: sorry, too many clients already\n")', src/db.rs:16:5
Nov 14 17:15:48 vps695005 bash[16115]: stack backtrace:
Nov 14 17:15:48 vps695005 bash[16115]: 0: backtrace::backtrace::libunwind::trace
Nov 14 17:15:48 vps695005 bash[16115]: at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
Nov 14 17:15:48 vps695005 bash[16115]: 1: backtrace::backtrace::trace_unsynchronized
Nov 14 17:15:48 vps695005 bash[16115]: at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
Nov 14 17:15:48 vps695005 bash[16115]: 2: std::sys_common::backtrace::_print_fmt
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/sys_common/backtrace.rs:78
Nov 14 17:15:48 vps695005 bash[16115]: 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/sys_common/backtrace.rs:59
Nov 14 17:15:48 vps695005 bash[16115]: 4: core::fmt::write
Nov 14 17:15:48 vps695005 bash[16115]: at src/libcore/fmt/mod.rs:1069
Nov 14 17:15:48 vps695005 bash[16115]: 5: std::io::Write::write_fmt
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/io/mod.rs:1537
Nov 14 17:15:48 vps695005 bash[16115]: 6: std::sys_common::backtrace::_print
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/sys_common/backtrace.rs:62
Nov 14 17:15:48 vps695005 bash[16115]: 7: std::sys_common::backtrace::print
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/sys_common/backtrace.rs:49
Nov 14 17:15:48 vps695005 bash[16115]: 8: std::panicking::default_hook::{{closure}}
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/panicking.rs:198
Nov 14 17:15:48 vps695005 bash[16115]: 9: std::panicking::default_hook
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/panicking.rs:218
Nov 14 17:15:48 vps695005 bash[16115]: 10: std::panicking::rust_panic_with_hook
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/panicking.rs:477
Nov 14 17:15:48 vps695005 bash[16115]: 11: rust_begin_unwind
Nov 14 17:15:48 vps695005 bash[16115]: at src/libstd/panicking.rs:385
Nov 14 17:15:48 vps695005 bash[16115]: 12: core::panicking::panic_fmt
Nov 14 17:15:48 vps695005 bash[16115]: at src/libcore/panicking.rs:89
Nov 14 17:15:48 vps695005 bash[16115]: 13: core::option::expect_none_failed
Nov 14 17:15:48 vps695005 bash[16115]: at src/libcore/option.rs:1272
Nov 14 17:15:48 vps695005 bash[16115]: 14: el_monitorro::db::establish_connection
Nov 14 17:15:48 vps695005 bash[16115]: 15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
Nov 14 17:15:48 vps695005 bash[16115]: 16: tokio::runtime::task::core::Core<T,S>::poll
Nov 14 17:15:48 vps695005 bash[16115]: 17: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
Nov 14 17:15:48 vps695005 bash[16115]: 18: tokio::runtime::task::harness::Harness<T,S>::poll
Nov 14 17:15:48 vps695005 bash[16115]: 19: std::thread::local::LocalKey<T>::with
Nov 14 17:15:48 vps695005 bash[16115]: 20: tokio::runtime::thread_pool::worker::Context::run_task
Nov 14 17:15:48 vps695005 bash[16115]: 21: tokio::runtime::thread_pool::worker::Context::run
Nov 14 17:15:48 vps695005 bash[16115]: 22: tokio::macros::scoped_tls::ScopedKey<T>::set
Nov 14 17:15:48 vps695005 bash[16115]: 23: tokio::runtime::thread_pool::worker::run
Nov 14 17:15:48 vps695005 bash[16115]: 24: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
Nov 14 17:15:48 vps695005 bash[16115]: 25: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
Nov 14 17:15:48 vps695005 bash[16115]: 26: tokio::runtime::task::harness::Harness<T,S>::poll
Nov 14 17:15:48 vps695005 bash[16115]: 27: tokio::runtime::blocking::pool::Inner::run
Nov 14 17:15:48 vps695005 bash[16115]: 28: tokio::runtime::context::enter
Nov 14 17:15:48 vps695005 bash[16115]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.