Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-30379

memcached std::bad_alloc on `./mcctl set trace.config`

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 6.5.0
    • 5.5.0
    • memcached
    • Triaged
    • Unknown

    Description

      memcached closes the connection after std::bad_alloc when `/mcctl set trace.config` provides the empty list for disabled-categories.

      [root@172-23-96-117 bin]# ./mcctl -h localhost:11210 -u Administrator -P password set trace.config 'buffer-mode:ring;buffer-size:20971520;enabled-categories:*;disabled-categories:mutex'
      [root@172-23-96-117 bin]# ./mcctl -h localhost:11210 -u Administrator -P password set trace.config 'buffer-mode:ring;buffer-size:20971520;enabled-categories:*;disabled-categories:'
      MemcachedConnection::readPlain: failed to read data: Connection reset by peer
      [root@172-23-96-117 bin]# ./mcctl -h localhost:11210 -u Administrator -P password get trace.config
      buffer-mode:ring;buffer-size:20971520;enabled-categories:*;disabled-categories:mutex
      

      Seen on http://perf.jenkins.couchbase.com/job/hera/1829. From memcached.log:

      2018-07-04T10:07:54.750273Z WARNING 282: exception occurred in runloop during packet execution. Cookie info: {"connection":"[ 127.0.0.1:46108 - 127.0.0.1:11210 (<ud>Administrator</ud>) ]","packet":{"bodylen":91,"
      cas":0,"datatype":"raw","extlen":0,"keylen":12,"magic":"ClientRequest","opaque":3735928559,"opcode":"IOCTL_SET","vbucket":0}} - closing connection: std::bad_alloc
      

      UPDATE 2018/07/06
      A temporary workaround to remove everything from the disabled-categories list is to set a single not-existing category:

      [root@172-23-96-117 bin]# ./mcctl -h localhost:11210 -u Administrator -P password set trace.config 'buffer-mode:ring;buffer-size:20971520;enabled-categories:*;disabled-categories:fake-category'
      [root@172-23-96-117 bin]# ./mcctl -h localhost:11210 -u Administrator -P password get trace.config
      buffer-mode:ring;buffer-size:20971520;enabled-categories:*;disabled-categories:fake-category
      [root@172-23-96-117 bin]# ./kv_trace_dump --mcctl ./mcctl -H localhost:11210 -u Administrator -P password ./trace.json
      [root@172-23-96-117 bin]# grep "mutex" trace.json | wc -l
      884
      

      Attachments

        For Gerrit Dashboard: MB-30379
        # Subject Branch Project Status CR V

        Activity

          People

            christopher.farman christopher farman (Inactive)
            paolo.cocchi Paolo Cocchi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty