diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2bc0753..d637b3d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,7 +16,7 @@ jobs: - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all --features=ntex/tokio + args: --all --features=ntex-net/tokio fmt: name: Rustfmt diff --git a/.github/workflows/cov.yml b/.github/workflows/cov.yml index 5398c19..dea8a8f 100644 --- a/.github/workflows/cov.yml +++ b/.github/workflows/cov.yml @@ -25,7 +25,7 @@ jobs: uses: Swatinem/rust-cache@v1.0.1 - name: Generate code coverage - run: cargo llvm-cov --features=ntex/compio --workspace --lcov --output-path lcov.info + run: cargo llvm-cov --features=ntex/tokio --workspace --lcov --output-path lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/CHANGES.md b/CHANGES.md index 4444c67..83f5be4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [4.1.1] - 2024-10-15 + +* Disconnect on error from service readiness check + ## [4.1.0] - 2024-10-10 * Do not check readiness for call diff --git a/Cargo.toml b/Cargo.toml index cd21479..c82a2a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex-mqtt" -version = "4.1.0" +version = "4.1.1" authors = ["ntex contributors <team@ntex.rs>"] description = "Client and Server framework for MQTT v5 and v3.1.1 protocols" documentation = "https://docs.rs/ntex-mqtt" diff --git a/src/io.rs b/src/io.rs index 8ae11de..490f067 100644 --- a/src/io.rs +++ b/src/io.rs @@ -489,11 +489,11 @@ where } // handle service readiness error Poll::Ready(Err(err)) => { - log::trace!("{}: Service readiness check failed, stopping", self.io.tag()); + log::error!("{}: Service readiness check failed, stopping", self.io.tag()); self.st = IoDispatcherState::Stop; self.flags.insert(Flags::READY_ERR); self.state.borrow_mut().error = Some(IoDispatcherError::Service(err)); - Poll::Ready(PollService::Continue) + Poll::Ready(PollService::Item(DispatchItem::Disconnect(None))) } } } diff --git a/tests/test_server.rs b/tests/test_server.rs index cb2a9a1..3325e98 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -452,7 +452,7 @@ async fn handle_or_drop_publish_after_disconnect( sleep(Millis(1750)).await; io.close(); drop(io); - sleep(Millis(500)).await; + sleep(Millis(750)).await; assert!(disconnect.load(Relaxed));