rabbitmq / rabbitmq-stream-dotnet-client

RabbitMQ client for the stream protocol
https://rabbitmq.github.io/rabbitmq-stream-dotnet-client/stable/htmlsingle/index.html
Other
122 stars 41 forks source link

Add debug info during the login step #301

Closed Gsantomaggio closed 1 year ago

Gsantomaggio commented 1 year ago

Releated to https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/issues/299

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.08% :warning:

Comparison is base (6bb73ea) 92.93% compared to head (d6577ec) 92.86%. Report is 1 commits behind head on main.

:exclamation: Current head d6577ec differs from pull request most recent head a04e8a2. Consider uploading reports for the commit a04e8a2 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #301 +/- ## ========================================== - Coverage 92.93% 92.86% -0.08% ========================================== Files 112 112 Lines 9688 9689 +1 Branches 769 771 +2 ========================================== - Hits 9004 8998 -6 - Misses 523 528 +5 - Partials 161 163 +2 ``` | [Files Changed](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq) | Coverage Δ | | |---|---|---| | [RabbitMQ.Stream.Client/Consts.cs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-UmFiYml0TVEuU3RyZWFtLkNsaWVudC9Db25zdHMuY3M=) | `66.66% <ø> (ø)` | | | [RabbitMQ.Stream.Client/RawConsumer.cs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-UmFiYml0TVEuU3RyZWFtLkNsaWVudC9SYXdDb25zdW1lci5jcw==) | `86.42% <0.00%> (+0.22%)` | :arrow_up: | | [RabbitMQ.Stream.Client/RawProducer.cs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-UmFiYml0TVEuU3RyZWFtLkNsaWVudC9SYXdQcm9kdWNlci5jcw==) | `87.71% <0.00%> (+0.37%)` | :arrow_up: | | [RabbitMQ.Stream.Client/AvailableFeatures.cs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-UmFiYml0TVEuU3RyZWFtLkNsaWVudC9BdmFpbGFibGVGZWF0dXJlcy5jcw==) | `79.16% <100.00%> (+0.90%)` | :arrow_up: | | [RabbitMQ.Stream.Client/Client.cs](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq#diff-UmFiYml0TVEuU3RyZWFtLkNsaWVudC9DbGllbnQuY3M=) | `89.66% <100.00%> (-0.81%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/rabbitmq/rabbitmq-stream-dotnet-client/pull/301/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rabbitmq)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Gsantomaggio commented 1 year ago

@aeb-dev Do you have a chance to test the PR?
it adds more debug information to understand what's going on.

Please enable the logs in debug mode. Thank you

aeb-dev commented 1 year ago

Sorry, I could not allocate time yet to test it. I will let you know as soon as possible

Gsantomaggio commented 1 year ago

@aeb-dev Ok no problem. I tried to reproduce the issue with the configuration you provided and it works.

Screenshot 2023-09-18 at 15 25 11

conf:

  var config = new StreamSystemConfig()
        {

            UserName = "test",
            Password = "test",
            VirtualHost = "test",
            AddressResolver = new AddressResolver(new DnsEndPoint("localhost", 30552)),
            Endpoints = new List<EndPoint> { new DnsEndPoint("localhost", 30552) },

        };
        var system = await StreamSystem.Create(config, streamLogger).ConfigureAwait(false);

Logs:

dbug: RabbitMQ.Stream.Client.StreamSystem[0]
      Server properties: [cluster_name, main-rabbitmq], [copyright, Copyright (c) 2007-2023 VMware, Inc. or its affiliates.], [information, Licensed under the MPL 2.0. Website: https://rabbitmq.com], [platform, Erlang/OTP 26.0.2], [product, RabbitMQ], [version, 3.13.0-beta.6]
dbug: RabbitMQ.Stream.Client.StreamSystem[0]
      Sasl mechanism: AMQPLAIN, PLAIN
dbug: RabbitMQ.Stream.Client.StreamSystem[0]
      Open: ConnectionProperties: [advertised_port, 5552], [advertised_host, main-rabbitmq-server-0.main-rabbitmq-nodes.default]
dbug: RabbitMQ.Stream.Client.StreamSystem[0]
      Extracted BrokerVersion version: 3.13.0
dbug: RabbitMQ.Stream.Client.StreamSystem[0]
      Client connected to Unspecified/localhost:30552
info: Filter.FilterConsumer[0]

I'll be looking forward to your feedback since I can't reproduce it.

aeb-dev commented 1 year ago

I get this log: Extracted BrokerVersion version: 3.13.0

aeb-dev commented 1 year ago

Okay, I found the problem.

Before testing for consumer filters I had another rabbitmq installed so I had updated that to test it. So after update, the new rabbitmq was using the old data of old rabbitmq.

You can produce the error with the following approach but I think this might not be a client problem:

First deploy rabbitmq with:

image: docker.io/rabbitmq:3.11.5

then update

image: docker.io/rabbitmq:3.13-rc-management

Then re-run the code from the issue.

Note: If I do a clean install everything works fine

Gsantomaggio commented 1 year ago

You have to enable the feature flags. Coming from an old version, the filter is disabled. Screenshot 2023-09-18 at 17 17 48

aeb-dev commented 1 year ago

After enabling, everything works as expected thanks

Gsantomaggio commented 1 year ago

I added the feature flag info in case of problem. That would help in the same situation