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

sending sending a very big message #450

Closed
khromenokroman opened this issue Sep 4, 2024 · 1 comment
Closed

sending sending a very big message #450

khromenokroman opened this issue Sep 4, 2024 · 1 comment

Comments

@khromenokroman
Copy link

use version 2.0.0 library

void DB::send_via_dbus(test_stages stage) {
    bool answer_dbus;

    sdbus::ServiceName service_name("ru.test.management");
    sdbus::ObjectPath object_path("/ru/test/management/converter");
    auto systemBus = sdbus::createSystemBusConnection();
    auto proxy = sdbus::createProxy(*systemBus, service_name, object_path);

    std::string name_method;
    if (stage == test_stages::COMMIT) {
        name_method = "commit";
    } else if (stage == test_stages::VALIDATE) {
        name_method = "validate";
    } else if (stage == test_stages::DONE) {
        name_method = "commit_done";
    }

    if (stage == test_stages::COMMIT || stage == test_stages::VALIDATE) {
        proxy->callMethod(name_method.c_str())
            .onInterface("ru.test.management.converter.test")
            .withArguments(cbuf_get(m_xml_buf.get()))
            .withTimeout(std::chrono::seconds(TIMEOUT))
            .storeResultsTo(answer_dbus);

    } else if (stage == test_stages::DONE) {
        proxy->callMethod(name_method.c_str())
            .onInterface("ru.test.management.converter.test")
            .withTimeout(std::chrono::seconds(TIMEOUT))
            .storeResultsTo(answer_dbus);
    }

    m_logger->write(LOG_NOTICE, fmt::format("Converter answer: {}", answer_dbus));

    if (!answer_dbus) {
        throw clixon_plugins::exception::error_converter("Error during configuration validation");
    }
}

when I send small deadlines, everything is fine, but when I send a line that I read from a 60-70 MB file, I get an exception, I understand correctly that this is a dbus limitation

it throws sdbus::Error with description "[org.freedesktop.DBus.Error.Disconnected] Connection reset by peer".

I tried to change the size of the message here /usr/share/dbus-1/system.conf in line <!-- <limit name="max_message_size">120400320</limit> -->, but it didn't help : (

<!-- <limit name="max_incoming_bytes">133169152</limit> -->
  <!-- <limit name="max_incoming_unix_fds">64</limit> -->
  <!-- <limit name="max_outgoing_bytes">133169152</limit> -->
  <!-- <limit name="max_outgoing_unix_fds">64</limit> -->
  <!-- <limit name="max_message_size">120400320</limit> -->
  <!-- <limit name="max_message_unix_fds">16</limit> -->
  <!-- <limit name="service_start_timeout">25000</limit> -->
  <!-- <limit name="auth_timeout">5000</limit> -->
  <!-- <limit name="pending_fd_timeout">150000</limit> -->
  <!-- <limit name="max_completed_connections">2048</limit> -->
  <!-- <limit name="max_incomplete_connections">64</limit> -->
  <!-- <limit name="max_connections_per_user">256</limit> -->
  <!-- <limit name="max_pending_service_starts">512</limit> -->
  <!-- <limit name="max_names_per_connection">512</limit> -->
  <!-- <limit name="max_match_rules_per_connection">512</limit> -->
  <!-- <limit name="max_replies_per_connection">128</limit> -->

@sangelovic I need heeelp

@sangelovic
Copy link
Collaborator

D-Bus is not intended for large data. A feasible approach here is to use other storage or transfer systems and use D-Bus as a transfer orchestration API.

Nevertheless, D-Bus specification allows D-Bus messages of size up to 128 Meg, so I guess that should work out of the box. Honestly, I never worked with such large messages so I can't really help you off the top of my head. Have you found the solution in the meantime?

@sangelovic sangelovic closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
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

2 participants