From reviews-return-43559-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Tue Aug 23 17:34:45 2016 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C27F2196EE for ; Tue, 23 Aug 2016 17:34:45 +0000 (UTC) Received: (qmail 56263 invoked by uid 500); 23 Aug 2016 17:34:45 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 56235 invoked by uid 500); 23 Aug 2016 17:34:45 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 56200 invoked by uid 99); 23 Aug 2016 17:34:45 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 17:34:45 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 3BFFF2CD30D; Tue, 23 Aug 2016 17:34:43 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1095893614033286759==" MIME-Version: 1.0 Subject: Review Request 51342: Printed out the received stream ID in scheduler API. From: Abhishek Dasgupta To: Anand Mazumdar , Vinod Kone , Zameer Manji Cc: Abhishek Dasgupta , mesos Date: Tue, 23 Aug 2016 17:34:43 -0000 Message-ID: <20160823173443.2090.96853@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Abhishek Dasgupta X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/51342/ X-Sender: Abhishek Dasgupta Reply-To: Abhishek Dasgupta X-ReviewRequest-Repository: mesos --===============1095893614033286759== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51342/ ----------------------------------------------------------- Review request for mesos, Anand Mazumdar, Vinod Kone, and Zameer Manji. Bugs: MESOS-6041 https://issues.apache.org/jira/browse/MESOS-6041 Repository: mesos Description ------- This patch prints out the received stream ID in error output caused by Mesos-Stream-Id mismatch in calls to scheduler http api. Expected stream ID is not printed in error output as it may cause security leak. Diffs ----- src/master/http.cpp 52dd80b856cf2317c0b73ba54bf501696786088d Diff: https://reviews.apache.org/r/51342/diff/ Testing ------- On Ubuntu 16.04: sudo make -j4 check Manual testing as well. Steps to reproduce: 1. Run mesos master. 2. Run Mesos Slave. 3. Subscribe a framework with the command : curl -v -H "Accept: application/json" -H "Content-Type: application/json" -d "@subscribe.json" http://127.0.0.1:5050/api/v1/scheduler subscribe.json : { "type" : "SUBSCRIBE", "subscribe" : { "framework_info" : { "user" : "bar", "name" : "Example HTTP Framework1" } } } 4. Accept an offer by following command : curl -v -H "Accept: application/json" -H "Content-Type: application/json" -H "Mesos-Stream-Id: 000a38b7-8a2a-4c8f-a374-f782d6ea617f" -d "@accept.json" http://127.0.0.1:5050/api/v1/scheduler accept.json: { "framework_id": { "value": "ee29ca2a-c56b-4a24-bba1-4919afae813e-0000" }, "type": "ACCEPT", "accept": { "offer_ids": [{ "value": "369108e7-2bff-4a54-aca0-4f63b11a9361-O0" }], "operations": [{ "type": "LAUNCH", "launch": { "task_infos": [{ "name": "My Task", "task_id": { "value": "12220-3440-12532-my-task" }, "agent_id": { "value": "94d32bba-2bb4-461f-bd96-30d155fe5965-S0" }, "executor": { "command": { "shell": true, "value": "sleep 1000" }, "executor_id": { "value": "12214-23523-my-executor" } }, "resources": [{ "name": "cpus", "role": "*", "type": "SCALAR", "scalar": { "value": 1.0 } }, { "name": "mem", "role": "*", "type": "SCALAR", "scalar": { "value": 128.0 } }] }] } }], "filters": { "refuse_seconds": 5.0 } } } Note: Mesos-Stream-Id passed through header in this curl command is left mismatched to that received from the response to subscribe call. 5. Following error output is received as response: The stream ID '000a38b7-8a2a-4c8f-a374-f782d6ea617f' included in this request didn't match the stream ID currently associated with framework ID 'd2740805-e94a-4dc0-ad9f-96ffe3daedb3-0000' Thanks, Abhishek Dasgupta --===============1095893614033286759==--