get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/100512/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 100512,
    "url": "http://patches.dpdk.org/api/patches/100512/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211005135909.726091-3-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20211005135909.726091-3-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211005135909.726091-3-bruce.richardson@intel.com",
    "date": "2021-10-05T13:59:06",
    "name": "[v6,2/5] telemetry: fix deletion of active sockets",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e7de6074dba184d079f4be3e5c84213d6d1313f1",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211005135909.726091-3-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 19390,
            "url": "http://patches.dpdk.org/api/series/19390/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19390",
            "date": "2021-10-05T13:59:04",
            "name": "improve telemetry support with in-memory mode",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/19390/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/100512/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/100512/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C4C30A0C4C;\n\tTue,  5 Oct 2021 16:18:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9718A41383;\n\tTue,  5 Oct 2021 16:18:04 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id 80EE54134B\n for <dev@dpdk.org>; Tue,  5 Oct 2021 16:18:01 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Oct 2021 06:59:22 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.151])\n by orsmga008.jf.intel.com with ESMTP; 05 Oct 2021 06:59:21 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10128\"; a=\"206563947\"",
            "E=Sophos;i=\"5.85,349,1624345200\"; d=\"scan'208\";a=\"206563947\"",
            "E=Sophos;i=\"5.85,349,1624345200\"; d=\"scan'208\";a=\"488044099\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ciara Power <ciara.power@intel.com>,\n David Marchand <david.marchand@redhat.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Kevin Traynor <ktraynor@redhat.com>,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Tue,  5 Oct 2021 14:59:06 +0100",
        "Message-Id": "<20211005135909.726091-3-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211005135909.726091-1-bruce.richardson@intel.com>",
        "References": "<20210915141030.23514-1-bruce.richardson@intel.com>\n <20211005135909.726091-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 2/5] telemetry: fix deletion of active sockets",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When DPDK is run with --in-memory mode, multiple processes can run\nsimultaneously using the same runtime dir. This leads to each process,\nas it starts up, removing the telemetry socket of another process,\ngiving unexpected behaviour.\n\nThis patch changes that behaviour to first check if the existing socket\nis active. If not, it's an old socket to be cleaned up and can be\nremoved. If it is active, telemetry initialization fails and an error\nmessage is printed out giving instructions on how to remove the error;\neither by using file-prefix to have a different runtime dir (and\ntherefore socket path) or by disabling telemetry if it not needed.\n\nFixes: 6dd571fd07c3 (\"telemetry: introduce new functionality\")\n\nReported-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Ciara Power <ciara.power@intel.com>\n---\n lib/telemetry/telemetry.c | 28 ++++++++++++++++++++++------\n 1 file changed, 22 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c\nindex 9021025a1b..bd804a25a9 100644\n--- a/lib/telemetry/telemetry.c\n+++ b/lib/telemetry/telemetry.c\n@@ -457,19 +457,35 @@ create_socket(char *path)\n \n \tstruct sockaddr_un sun = {.sun_family = AF_UNIX};\n \tstrlcpy(sun.sun_path, path, sizeof(sun.sun_path));\n-\tunlink(sun.sun_path);\n+\tTMTY_LOG(DEBUG, \"Attempting socket bind to path '%s'\\n\", path);\n+\n \tif (bind(sock, (void *) &sun, sizeof(sun)) < 0) {\n \t\tstruct stat st;\n \n-\t\tTMTY_LOG(ERR, \"Error binding socket: %s\\n\", strerror(errno));\n-\t\tif (stat(socket_dir, &st) < 0 || !S_ISDIR(st.st_mode))\n+\t\t/* first check if we have a runtime dir */\n+\t\tif (stat(socket_dir, &st) < 0 || !S_ISDIR(st.st_mode)) {\n \t\t\tTMTY_LOG(ERR, \"Cannot access DPDK runtime directory: %s\\n\", socket_dir);\n-\t\tsun.sun_path[0] = 0;\n-\t\tgoto error;\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\t/* check if current socket is active */\n+\t\tif (connect(sock, (void *)&sun, sizeof(sun)) == 0) {\n+\t\t\tTMTY_LOG(ERR, \"Error binding telemetry socket, path already in use\\n\");\n+\t\t\tTMTY_LOG(ERR, \"Use '--file-prefix' to select a different socket path, or '--no-telemetry' to disable\\n\");\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\t/* socket is not active, delete and attempt rebind */\n+\t\tunlink(sun.sun_path);\n+\t\tif (bind(sock, (void *) &sun, sizeof(sun)) < 0) {\n+\t\t\tTMTY_LOG(ERR, \"Error binding socket: %s\\n\", strerror(errno));\n+\t\t\tgoto error;\n+\t\t}\n \t}\n \n \tif (listen(sock, 1) < 0) {\n \t\tTMTY_LOG(ERR, \"Error calling listen for socket: %s\\n\", strerror(errno));\n+\t\tunlink(sun.sun_path);\n \t\tgoto error;\n \t}\n \n@@ -477,7 +493,7 @@ create_socket(char *path)\n \n error:\n \tclose(sock);\n-\tunlink_sockets();\n+\tpath[0] = 0;\n \treturn -1;\n }\n \n",
    "prefixes": [
        "v6",
        "2/5"
    ]
}