Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2785

[Go] Message of certain size fail to be marshalled by amqp module

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • proton-c-0.40.0
    • None
    • None

    Description

      We used to use golang bindings of qpid-proton of quite old version (v0.33.0) in our project. After upgrade to v0.39.0 message transfer fails on panics during message marshaling. Basically messages of certain size and higher (218 bytes in my lab environment) panics on second send. The first one always passes without an issue:

      [stack@tripleo-standalone sensubility]$ go run reproducer.go --address amqp://127.0.0.1:5666
      [0] Sending two messages of size 217 bytes.
      [1] Sending two messages of size 220 bytes.
      [0] Sent message ACKed.
      [0] Sent message ACKed.
      [1] Sent message ACKed.
      panic: cannot marshal string: overflow: not enough space to encodegoroutine 35 [running]:
      github.com/apache/qpid-proton/go/pkg/amqp.marshal({0x53d080?, 0xc00019a030?}, 0x7f5938001d20)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/amqp/marshal.go:295 +0x9e5
      github.com/apache/qpid-proton/go/pkg/amqp.putData({0x53d080, 0xc00019a030}, 0xc00012bd10?)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/amqp/message.go:508 +0x48
      github.com/apache/qpid-proton/go/pkg/amqp.(*message).put(0xc00019c280, 0xc00012bd48?)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/amqp/message.go:560 +0x2b8
      github.com/apache/qpid-proton/go/pkg/amqp.(*MessageCodec).Encode(0x7f5934000c90?, {0x5a47b0?, 0xc00019c280?}, {0x0, 0x0, 0x0})
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/amqp/message.go:380 +0x97
      github.com/apache/qpid-proton/go/pkg/electron.(*sender).send(0xc0000bc000, 0xc000194150)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/sender.go:197 +0x11d
      github.com/apache/qpid-proton/go/pkg/electron.(*sender).trySend(0xc0000bc000)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/sender.go:187 +0x25
      github.com/apache/qpid-proton/go/pkg/electron.(*sender).startSend(...)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/sender.go:179
      github.com/apache/qpid-proton/go/pkg/electron.(*sender).SendAsyncTimeout.func1()
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/sender.go:230 +0xbb
      github.com/apache/qpid-proton/go/pkg/proton.(*Engine).Run(0xc0001261b0)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/proton/engine.go:376 +0x134
      github.com/apache/qpid-proton/go/pkg/electron.(*connection).run(0xc0001320f0)
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/connection.go:241 +0x3f
      created by github.com/apache/qpid-proton/go/pkg/electron.NewConnection in goroutine 1
              /home/stack/go/pkg/mod/github.com/apache/qpid-proton@v0.0.0-20231031074257-058dcaa83a7e/go/pkg/electron/connection.go:224 +0x545
      exit status 2

       

      We used to transfer much larger messages, so this is quite problematic for us. The AMQP components we use for message transfer is qdrouterd mesh, but it is reproducible on single qdr too.

      [root@tripleo-standalone ~]# podman exec -it qdr qdstat -v
      2023-12-22 10:26:29.995103 UTC
      Standalone_n6PHE7MhBoAhzi8Router Statistics
        attr                             value
        =============================================================
        Version                          1.17.1
        Mode                             standalone
        Router Id                        Standalone_n6PHE7MhBoAhzi8
        Worker Threads                   4
        Uptime                           002:21:05:22
        VmSize                           332 MiB
        Area                             0
        Link Routes                      0
        Auto Links                       0
        Links                            2
        Nodes                            0
        Addresses                        4
        Connections                      1
        Presettled Count                 278
        Dropped Presettled Count         3
        Accepted Count                   1894
        Rejected Count                   0
        Released Count                   0
        Modified Count                   0
        Deliveries Delayed > 1sec        0
        Deliveries Delayed > 10sec       0
        Deliveries Stuck > 10sec         0
        Deliveries to Fallback           0
        Links Blocked                    0
        Ingress Count                    2173
        Egress Count                     2172
        Transit Count                    0
        Deliveries from Route Container  0
        Deliveries to Route Container    0
      [root@tripleo-standalone ~]# 

      Minimal reproducer is attached: qpid-reproducer.go

       

      Attachments

        1. qpid-reproducer.go
          3 kB
          Martin

        Activity

          People

            Unassigned Unassigned
            mmagr Martin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: