Giter Club home page Giter Club logo

Comments (5)

riz0id avatar riz0id commented on August 10, 2024 1

@Friede80 @ixmatus I'm unable to replicate the two remaining issues after fixing the test in #41. I think its very likely that in the case the second "LongBytes" call finished before the first call (made with Async.async) was left running and resulted in some undefined weirdness. If this is true, it would explain why test results are non-deterministic, since the specific way in which the stray async caused issues in the test would be a race condition between the first and second "LongBytes" client calls.

from grpc-mqtt.

ixmatus avatar ixmatus commented on August 10, 2024

@riz0id is this related (or at least the last failure) to the bug you mentioned the other day that is being masked by having compression turned on?

from grpc-mqtt.

rkaippully avatar rkaippully commented on August 10, 2024

It looks like the failures started with a9a7c5f.

from grpc-mqtt.

riz0id avatar riz0id commented on August 10, 2024
Running 1 test suites...
Test suite test: RUNNING...
Tests: grpc-mqtt
  <...>
  Test.Service
    Normal
      LongBytes:                           FAIL
        Exception: MQTTException "disconnected"
      Call:                                SKIP
    Test.Service.ClientStream
      Test.Service.ClientStream.Unbatched: SKIP
      Batched:                             SKIP
    Test.Service.ServerStream
      Test.Service.ServerStream.Unbatched: SKIP
      Test.Service.ServerStream.Batched:   SKIP
    Test.Service.BiDiStream
      Test.Service.BiDiStream.Unbatched:   SKIP
      Batched:                             SKIP
    Test.Service.Errors
      Test.Service.Errors.Timeout:         SKIP
      Test.Service.Errors.Missing:         SKIP
      Test.Service.Errors.Malform:         SKIP

11 out of 39 tests failed (20.43s)
Test suite test: FAIL

Currently the "LongBytes" test makes a total of 16 calls each receiving a 8mb response:

        _ <- Async.async do
          withMQTTGRPCClient logger clientConfig \client ->
            Async.replicateConcurrently 8 do
              uuid <- UUID.nextRandom

              let msg = Message.OneInt 8
              let rqt = GRPC.MQTT.MQTTNormalRequest msg 8 (GRPC.Client.MetadataMap (Map.fromList [("rqt-uuid", [UUID.toASCIIBytes uuid])]))

              testServicecallLongBytes (testServiceMqttClient client baseTopic) rqt

        withMQTTGRPCClient logger clientConfig \client ->
          Async.replicateConcurrently 8 do

            -- For uniquely identifying requests to the server.
            uuid <- UUID.nextRandom

            -- NB: 2022-08-02 we discovered a bug with concurrent client
            -- requests that send responses which, when sent back by the
            -- server trigger a GRPCIOTimeout error in some of the clients.
            let msg = Message.OneInt 8
            let rqt = GRPC.MQTT.MQTTNormalRequest msg 8 (GRPC.Client.MetadataMap (Map.fromList [("rqt-uuid", [UUID.toASCIIBytes uuid])]))

            testServicecallLongBytes (testServiceMqttClient client baseTopic) rqt

MQTTDisconnected is from a timeout result being eaten. The first of these two MQTTGRPCClients (the one that is ignored) timing out which is causing the second call to be disconnected. Anyway, the test needs to be re-written, the ignored result is an artifact from late night debugging. The correct test code would just be:

        withMQTTGRPCClient logger clientConfig \client ->
          Async.replicateConcurrently 8 do

            -- For uniquely identifying requests to the server.
            uuid <- UUID.nextRandom

            -- NB: 2022-08-02 we discovered a bug with concurrent client
            -- requests that send responses which, when sent back by the
            -- server trigger a GRPCIOTimeout error in some of the clients.
            let msg = Message.OneInt 8
            let rqt = GRPC.MQTT.MQTTNormalRequest msg 8 (GRPC.Client.MetadataMap (Map.fromList [("rqt-uuid", [UUID.toASCIIBytes uuid])]))

            testServicecallLongBytes (testServiceMqttClient client baseTopic) rqt

I can fix this, I'm still looking at the other issues.

from grpc-mqtt.

riz0id avatar riz0id commented on August 10, 2024

Thank you for finding this @Friede80 !

from grpc-mqtt.

Related Issues (5)

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.