Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-16 Thread Vinod Kone

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102995
---

Ship it!


It's unfortunate to do EXITs for bad user inputs in a library, but am not sure 
what else can we do here.

- Vinod Kone


On Oct. 16, 2015, 12:30 a.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated Oct. 16, 2015, 12:30 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Artem Harutyunyan, and Vinod Kone.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The master detector is created during construction of the `MesosProcess`.  If 
> the flags cannot be loaded or if the `MasterDetector::create` fails, the 
> master detector will be null and will result in a segfault if it is used 
> during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Joseph Wu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/
---

(Updated Oct. 15, 2015, 5:03 p.m.)


Review request for mesos, Anand Mazumdar and Artem Harutyunyan.


Changes
---

Change ABORT to EXIT.


Bugs: MESOS-3748
https://issues.apache.org/jira/browse/MESOS-3748


Repository: mesos


Description
---

If not, the process will segfault during initialization.


Diffs (updated)
-

  src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 

Diff: https://reviews.apache.org/r/39365/diff/


Testing (updated)
---

`make check`

```
export DEFAULT_PRINCIPAL=root
build/src/event-call-framework --master="asdf://127.0.0.1:5050"
```
Check that it does not segfault.


Thanks,

Joseph Wu



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102860
---


Patch looks great!

Reviews applied: [39365]

All tests passed.

- Mesos ReviewBot


On Oct. 16, 2015, 12:30 a.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated Oct. 16, 2015, 12:30 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Artem Harutyunyan, and Vinod Kone.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The master detector is created during construction of the `MesosProcess`.  If 
> the flags cannot be loaded or if the `MasterDetector::create` fails, the 
> master detector will be null and will result in a segfault if it is used 
> during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Guangya Liu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102856
---

Ship it!


Ship It!

- Guangya Liu


On 十月 16, 2015, 12:30 a.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated 十月 16, 2015, 12:30 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Artem Harutyunyan, and Vinod Kone.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The master detector is created during construction of the `MesosProcess`.  If 
> the flags cannot be loaded or if the `MasterDetector::create` fails, the 
> master detector will be null and will result in a segfault if it is used 
> during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Anand Mazumdar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102837
---

Ship it!


LGTM

- Anand Mazumdar


On Oct. 16, 2015, 12:03 a.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated Oct. 16, 2015, 12:03 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> If not, the process will segfault during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Joseph Wu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/
---

(Updated Oct. 15, 2015, 5:30 p.m.)


Review request for mesos, Anand Mazumdar, Artem Harutyunyan, and Vinod Kone.


Changes
---

Change the other `return` to an `exit` in the constructor.


Bugs: MESOS-3748
https://issues.apache.org/jira/browse/MESOS-3748


Repository: mesos


Description (updated)
---

The master detector is created during construction of the `MesosProcess`.  If 
the flags cannot be loaded or if the `MasterDetector::create` fails, the master 
detector will be null and will result in a segfault if it is used during 
initialization.


Diffs (updated)
-

  src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 

Diff: https://reviews.apache.org/r/39365/diff/


Testing
---

`make check`

```
export DEFAULT_PRINCIPAL=root
build/src/event-call-framework --master="asdf://127.0.0.1:5050"
```
Check that it does not segfault.


Thanks,

Joseph Wu



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Vinod Kone

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102841
---



src/scheduler/scheduler.cpp (line 170)


For posterity, can you add a blurb in the review on what the exact issue is?

Also, are the other error() calls in this method safe to execute?


- Vinod Kone


On Oct. 16, 2015, 12:03 a.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated Oct. 16, 2015, 12:03 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> If not, the process will segfault during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>



Re: Review Request 39365: HTTP Scheduler should abort when MasterDetector create fails.

2015-10-15 Thread Joseph Wu


> On Oct. 15, 2015, 5:13 p.m., Vinod Kone wrote:
> > src/scheduler/scheduler.cpp, line 170
> > 
> >
> > For posterity, can you add a blurb in the review on what the exact 
> > issue is?
> > 
> > Also, are the other error() calls in this method safe to execute?

Can do.

There are 2 other `error()` calls:
1) In the initialization, in case the flags fail to parse.  This one will lead 
to a segfault.
2) In the master detection loop (after initialization).  This one is ok, since 
we handle it by retrying in a loop.


- Joseph


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39365/#review102841
---


On Oct. 15, 2015, 5:03 p.m., Joseph Wu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39365/
> ---
> 
> (Updated Oct. 15, 2015, 5:03 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-3748
> https://issues.apache.org/jira/browse/MESOS-3748
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> If not, the process will segfault during initialization.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 56801ca6ffc9f9f0e4bd12dbf535e9c5251c2712 
> 
> Diff: https://reviews.apache.org/r/39365/diff/
> 
> 
> Testing
> ---
> 
> `make check`
> 
> ```
> export DEFAULT_PRINCIPAL=root
> build/src/event-call-framework --master="asdf://127.0.0.1:5050"
> ```
> Check that it does not segfault.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>