Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panics on broken pipe #15

Open
bestouff opened this issue Nov 23, 2016 · 4 comments
Open

panics on broken pipe #15

bestouff opened this issue Nov 23, 2016 · 4 comments

Comments

@bestouff
Copy link

Hi,

in mqttc-0.1.4/src/client.rs, line 690:

    fn _write_packet(&mut self, packet: &Packet) {
        trace!("{:?}", packet);
        self.conn.write_packet(&packet).unwrap();
    }

the unwrap() panics:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Error { repr: Os { code: 32, message: "Broken pipe" } })', src/libcore/result.rs:799
stack backtrace:
   1:     0x7f0d11cdadcf - std::sys::backtrace::tracing::imp::write::h6f1d53a70916b90d
   2:     0x7f0d11cdf48d - std::panicking::default_hook::{{closure}}::h137e876f7d3b5850
   3:     0x7f0d11cddfe0 - std::panicking::default_hook::h0ac3811ec7cee78c
   4:     0x7f0d11cde5e8 - std::panicking::rust_panic_with_hook::hc303199e04562edf
   5:     0x7f0d11cde482 - std::panicking::begin_panic::h6ed03353807cf54d
   6:     0x7f0d11cde3c0 - std::panicking::begin_panic_fmt::hc321cece241bb2f5
   7:     0x7f0d11cde341 - rust_begin_unwind
   8:     0x7f0d11d1215f - core::panicking::panic_fmt::h27224b181f9f037f
   9:     0x7f0d11ad97a2 - core::result::unwrap_failed::hf1a3b54c69e1eeef
                        at /build/rustc-1.13.0+dfsg1/src/libcore/macros.rs:29
  10:     0x7f0d11acfad3 - <core::result::Result<T, E>>::unwrap::haa3663173b183954
                        at /build/rustc-1.13.0+dfsg1/src/libcore/result.rs:737
  11:     0x7f0d11aeb64c - mqttc::client::Client::_write_packet::h28186173ff27678d
                        at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/mqttc-0.1.4/src/client.rs:690
  12:     0x7f0d11aec2f5 - mqttc::client::Client::_publish::h83daa8036786cf37
                        at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/mqttc-0.1.4/src/client.rs:647
  13:     0x7f0d11ae2bbb - <mqttc::client::Client as mqttc::PubSub>::publish::hba48b09bebf91cde
                        at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/mqttc-0.1.4/src/client.rs:215
...

Could it return something meaningful instead ?

@bestouff
Copy link
Author

bestouff commented Dec 7, 2016

ping ?

@inre
Copy link
Owner

inre commented Dec 20, 2016

Let me see

@bestouff
Copy link
Author

bestouff commented Jan 3, 2017

(FWIW I don't think using unwrap() in libraries is idiomatic in rust, because of the induced panic.)

@ZaWertun
Copy link

ZaWertun commented May 10, 2017

Got this errors when keep_alive was set to 5 sec.
With 60 sec error rate is significantly reduced.

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

No branches or pull requests

3 participants