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

Cleanup errors, update dependencies #1396

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 59 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions bench/src/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,10 @@ impl Consumer {
let latency = before_poll.elapsed();

if let Err(e) = polled_messages {
if let IggyError::InvalidResponse(code, _, _) = e {
if code == 2010 {
topic_not_found_counter += 1;
if topic_not_found_counter > 1000 {
return Err(e);
}
if matches!(e, IggyError::TopicIdNotFound(_, _)) {
topic_not_found_counter += 1;
if topic_not_found_counter > 1000 {
return Err(e);
}
} else {
return Err(e);
Expand Down
6 changes: 3 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iggy-cli"
version = "0.8.3"
version = "0.8.4"
edition = "2021"
authors = ["[email protected]"]
repository = "https://github.com/iggy-rs/iggy"
Expand All @@ -20,10 +20,10 @@ anyhow = "1.0.86"
clap = { version = "4.5.17", features = ["derive"] }
clap_complete = "4.5.26"
figlet-rs = "0.1.5"
iggy = { path = "../sdk", features = ["iggy-cli"], version = "0.6.50" }
iggy = { path = "../sdk", features = ["iggy-cli"], version = "0.6.60" }
keyring = { version = "3.2.0", features = ["sync-secret-service", "vendored"], optional = true }
passterm = "2.0.1"
thiserror = "1.0.61"
thiserror = "2.0.9"
tokio = { version = "1.40.0", features = ["full"] }
tracing = "0.1.37"
tracing-appender = "0.2.2"
Expand Down
34 changes: 11 additions & 23 deletions cli/src/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,29 +159,17 @@ impl<'a> IggyCredentials<'a> {
let login_result =
client.login_with_personal_access_token(token_value).await;
if let Err(err) = login_result {
match err {
IggyError::InvalidResponse(code, _, _) => {
// Check what does the code means and if that's one of the cases
// when we should delete the session and inform user to try login again
// TODO: improve this part when we have more information about the codes
if code == IggyError::ResourceNotFound(String::new()).as_code()
|| code == IggyError::Unauthenticated.as_code()
|| code
== IggyError::PersonalAccessTokenExpired(
String::new(),
0,
)
.as_code()
{
let server_session =
ServerSession::new(server_address.clone());
server_session.delete()?;
bail!("Login session expired for Iggy server: {server_address}, please login again or use other authentication method");
}
}
_ => {
bail!("Problem with server login with token: {token_value}");
}
if matches!(
err,
IggyError::Unauthenticated
| IggyError::ResourceNotFound(_)
| IggyError::PersonalAccessTokenExpired(_, _)
) {
let server_session = ServerSession::new(server_address.clone());
server_session.delete()?;
bail!("Login session expired for Iggy server: {server_address}, please login again or use other authentication method");
} else {
bail!("Problem with server login with token: {token_value}");
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions configs/server.toml
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,6 @@ path = "backup"
# Subpath of the backup directory where converted segment data is stored after compatibility conversion.
path = "compatibility"

# Legacy database configuration - used only for the migration purposes.
#[system.database]
## Path for storing database files.
## Specifies the directory where database files are stored, relative to `system.path`.
#path = "database"

[system.state]
# Determines whether to enforce file synchronization on state updates (boolean).
# `true` ensures immediate writing of data to disk for durability.
Expand Down
13 changes: 2 additions & 11 deletions integration/tests/server/scenarios/message_size_scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use iggy::client::{MessageClient, StreamClient, TopicClient};
use iggy::clients::client::IggyClient;
use iggy::consumer::Consumer;
use iggy::error::IggyError;
use iggy::error::IggyError::InvalidResponse;
use iggy::messages::poll_messages::PollingStrategy;
use iggy::messages::send_messages::{Message, Partitioning};
use iggy::models::header::{HeaderKey, HeaderValue};
Expand Down Expand Up @@ -65,21 +64,13 @@ pub async fn run(client_factory: &dyn ClientFactory) {
send_message_and_check_result(
&client,
MessageToSend::OfSizeWithHeaders(100_001, 10_000_000),
Err(InvalidResponse(
4017,
23,
"Too big headers payload".to_owned(),
)),
Err(IggyError::TooBigHeadersPayload),
)
.await;
send_message_and_check_result(
&client,
MessageToSend::OfSizeWithHeaders(100_000, 10_000_001),
Err(InvalidResponse(
4022,
23,
"Too big message payload".to_owned(),
)),
Err(IggyError::TooBigMessagePayload),
)
.await;

Expand Down
3 changes: 1 addition & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iggy"
version = "0.6.51"
version = "0.6.60"
description = "Iggy is the persistent message streaming platform written in Rust, supporting QUIC, TCP and HTTP transport protocols, capable of processing millions of messages per second."
edition = "2021"
license = "MIT"
Expand Down Expand Up @@ -40,7 +40,6 @@ humantime = "2.1.0"
keyring = { version = "3.2.0", optional = true, features = ["sync-secret-service", "vendored"] }
lazy_static = "1.4.0"
passterm = { version = "2.0.1", optional = true }
pem = { version = "3.0.4" }
quinn = { version = "0.11.5" }
regex = "1.10.4"
reqwest = { version = "0.12.9", default-features = false, features = ["json", "rustls-tls"] }
Expand Down
Loading
Loading