Giter VIP home page Giter VIP logo

Comments (6)

mzimbres avatar mzimbres commented on May 18, 2024 1

Fixed in commit 56c0b28

from redis.

mzimbres avatar mzimbres commented on May 18, 2024

The content you are sending on the publisher is humm is this also causing the problem?

from redis.

mzimbres avatar mzimbres commented on May 18, 2024

I can reproduce, but only in release mode, not in debug.

from redis.

nejati-deriv avatar nejati-deriv commented on May 18, 2024

I can reproduce, but only in release mode, not in debug.

It might be dependent to memory layout, I'm using clang-15 and it occurs in debug too.
Try another message that might happens in debug too.

from redis.

mzimbres avatar mzimbres commented on May 18, 2024

A subscriber implemented with low-level functions doesn't suffer from that problem, so it looks like it is not a parser problem. I it receives EOF from the server, perhaps for being able to keep-up with the high volume of messages, I have to measure more, see below

#include <boost/asio.hpp>
#include <iostream>

#include <aedis.hpp>
#include <aedis/src.hpp>

namespace net = boost::asio;
namespace resp3 = aedis::resp3;
using resolver = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::resolver>;
using tcp_socket = net::use_awaitable_t<>::as_default_on_t<net::ip::tcp::socket>;
using aedis::adapter::adapt2;
using net::ip::tcp;

auto co_main(std::string host, std::string port) -> net::awaitable<void>
{
   try {
   auto ex = co_await net::this_coro::executor;

   resolver resv{ex};
   auto const addrs = co_await resv.async_resolve("127.0.0.1", "6379");
   tcp_socket socket{ex};
   co_await net::async_connect(socket, addrs);

   // Creates the request and writes to the socket.
   resp3::request req;
   req.push("HELLO", 3);
   req.push("SUBSCRIBE", "test-channel");
   co_await resp3::async_write(socket, req);

   std::string buffer, resp;

   auto dbuffer = net::dynamic_buffer(buffer);
   for (;;) {
      co_await resp3::async_read(socket, dbuffer);
      //std::cout << "ddd" << std::endl;
   }
   } catch(std::exception const& e) {
      std::cout << e.what() << std::endl;
   }
}

int main()
{
    net::io_context ioc{};
    net::co_spawn(ioc, co_main("127.0.0.1", "6379"), net::detached);
    ioc.run();
}

from redis.

nejati-deriv avatar nejati-deriv commented on May 18, 2024

It seems max_read_size in make_dynamic_buffer is related to this issue, tuning it to something higher for example 512000 solves the issue.
https://github.com/mzimbres/aedis/blob/c88fcfb9edbaca3cc90e761d8b3087c0eed4a9fb/include/aedis/detail/connection_base.hpp#L306

from redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.