----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51342/#review146566 -----------------------------------------------------------
Fix it, then Ship it! Modulo Vinod's comment. src/master/http.cpp (line 847) <https://reviews.apache.org/r/51342/#comment213072> Don't quote the `frameworkId` as it can't have spaces. - Anand Mazumdar On Aug. 23, 2016, 5:55 p.m., Abhishek Dasgupta wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51342/ > ----------------------------------------------------------- > > (Updated Aug. 23, 2016, 5:55 p.m.) > > > 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 > 'ee29ca2a-c56b-4a24-bba1-4919afae813e-0000' > > > Thanks, > > Abhishek Dasgupta > >
