arthurprs / floki

Floki Message Queue
MIT License
91 stars 11 forks source link

Tried helloworld example: both client and server crashed #9

Closed rohitjoshi closed 8 years ago

rohitjoshi commented 8 years ago

I built and tried helloworld example on mac-book and both client/server are crashing.

Floki log:

RUST_BACKTRACE=1 RUST_LOG=floki=info cargo run
     Running `target/debug/floki`
INFO:floki: starting up
INFO:floki::server: Opening queues...
INFO:floki::server: Opening queue "my_queue"
INFO:floki::queue_backend: [my_queue] checkpoint loaded: QueueBackendCheckpoint { segments: [SegmentCheckpoint { tail: 1, head: 125, sync_offset: 5584, closed: false }] }
WARN:floki::queue_backend: ["./data/my_queue/000000000000001.data"] expected id 125 got 0 when recovering @5584
INFO:floki::queue: [my_queue] checkpoint loaded: Ready
INFO:floki: starting event loop
INFO:floki::queue_backend: [my_queue] checkpointed: [SegmentCheckpoint { tail: 1, head: 125, sync_offset: 5584, closed: false }]
INFO:floki::queue: [my_queue] checkpointed: Ready
INFO:floki::queue_backend: [my_queue] checkpointed: [SegmentCheckpoint { tail: 1, head: 125, sync_offset: 5584, closed: false }]
INFO:floki::queue: [my_queue] checkpointed: Ready
INFO:floki::server: assigned token Token(1) to client V4(127.0.0.1:61418)
INFO:floki::server: creating queue "my_queue" channel "channel_1"
INFO:floki::server: creating queue "my_queue" channel "channel_2"
INFO:floki::server: assigned token Token(2) to client V4(127.0.0.1:61419)
INFO:floki::server: assigned token Token(3) to client V4(127.0.0.1:61420)
INFO:floki::server: assigned token Token(4) to client V4(127.0.0.1:61421)
INFO:floki::server: assigned token Token(5) to client V4(127.0.0.1:61422)
INFO:floki::server: closing token Token(2) client
thread '<main>' panicked at 'assertion failed: `(left == right)` (left: `Readable | Writable`, right: `Readable`)', src/server.rs:834
stack backtrace:
   1:        0x10316c718 - sys::backtrace::tracing::imp::write::h32380eb2460086d2mWt
   2:        0x10316e04f - panicking::log_panic::_<closure>::closure.41658
   3:        0x10316dad1 - panicking::log_panic::h5bd130ecc1f616afyPx
   4:        0x10315e4d6 - sys_common::unwind::begin_unwind_inner::hf3f0868d52ab85beoZs
   5:        0x10315eafe - sys_common::unwind::begin_unwind_fmt::h1d52f0c1e48facd2uYs
   6:        0x10304a589 - server::Server::ready::h6f4963e29b5ad0f8Pzd
   7:        0x1030572fe - server::ServerHandler.Handler::ready::h203c0a070f4bffd2aNd
   8:        0x102f448c3 - event_loop::EventLoop<H>::io_event::io_event::h17452341913126285399
   9:        0x102f447d9 - event_loop::EventLoop<H>::io_process::io_process::h3125720144754587274
  10:        0x102f440e8 - event_loop::EventLoop<H>::run_once::run_once::h16836368678178756876
  11:        0x102f43af1 - event_loop::EventLoop<H>::run::run::h947473040700634305
  12:        0x102f237fc - main::h54061b420d29a3340hg
  13:        0x10316d832 - sys_common::unwind::try::try_fn::h4737994515490642073
  14:        0x10316bb58 - __rust_try
  15:        0x10316d6d9 - rt::lang_start::h79f614af887db3afGMx
  16:        0x102f46cd9 - main
INFO:floki::queue_backend: [my_queue] checkpointed: [SegmentCheckpoint { tail: 1, head: 157, sync_offset: 7024, closed: false }]
INFO:floki::queue: [my_queue] checkpointed: Ready
Process didn't exit successfully: `target/debug/floki` (exit code: 101)

helloword example:

target/debug/examples/helloworld
channel_1 received msg: id 15 ticket 1831916728403976237 body "message 1 from producer 1"
channel_1 received msg: id 16 ticket 3075441350875930991 body "message 2 from producer 1"
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Connection reset by peer (os error 54)thread '', thread '<unnamed>../src/libcore/result.rs<unnamed>' panicked at ':' panicked at 'called `Result::unwrap()` on an `Err` value: Could not read enough bytesassertion failed: `(left == right)` (left: `Err(Could not read enough bytes)`, right: `Ok(2)`)688thread '', ',
<unnamed>../src/libcore/result.rsexamples/helloworld.rs' panicked at ':called `Result::unwrap()` on an `Err` value: Could not read enough bytes688',
../src/libcore/result.rs:688
:31
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Any', ../src/libcore/result.rs:688
arthurprs commented 8 years ago

Thanks for the report. I'll look into it.

arthurprs commented 8 years ago

Hello, can you try again using latest code from master?

rohitjoshi commented 8 years ago

It worked. Thx.