You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2018/11/14 14:36:13 UTC

Review Request 69338: Change agent to not report disconnected resource providers.

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

Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.


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


Repository: mesos


Description
-------

This patch changes the agent to not report disconnected resource
providers in the `UpdateSlaveMessage` it emits. We also fix how it
generates resource provider-related updates when no resource providers
are connected to allow the master to react properly when a resource
provider disappears.


Diffs
-----

  src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb 
  src/tests/resource_provider_manager_tests.cpp 5bb740edc7c3cc8698aede4f2ed57c21232fe378 


Diff: https://reviews.apache.org/r/69338/diff/1/


Testing
-------

`make check`


Thanks,

Benjamin Bannier


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review210548
-----------------------------------------------------------



PASS: Mesos patch 69338 was successfully built and tested.

Reviews applied: `['69337', '69338']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2598/mesos-review-69338

- Mesos Reviewbot Windows


On Nov. 14, 2018, 2:36 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2018, 2:36 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb 
>   src/tests/resource_provider_manager_tests.cpp 5bb740edc7c3cc8698aede4f2ed57c21232fe378 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/1/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On Dec. 7, 2018, 3:28 a.m., Chun-Hung Hsiao wrote:
> > src/slave/slave.cpp
> > Line 7595 (original), 7598 (patched)
> > <https://reviews.apache.org/r/69338/diff/1/?file=2107898#file2107898line7598>
> >
> >     It seems to me that the compiler should be able to hoist `message.mutable_resource_providers()` outside the loop so there is no need to do it manually. But I'm fine with this change.

We want to set this field even if there are no `resourceProviders` to iterate over. I'll add a comment.


> On Dec. 7, 2018, 3:28 a.m., Chun-Hung Hsiao wrote:
> > src/slave/slave.cpp
> > Lines 7873-7874 (original), 7875-7876 (patched)
> > <https://reviews.apache.org/r/69338/diff/1/?file=2107898#file2107898line7876>
> >
> >     These comments need to be updated.
> >     
> >     I was wondering now that, since we already have this empty resource logic here, why do we still see stale resource in the master? Is it because that in the case of agent restart, no `DISCONNECT` message is triggered, and thus we never clean up the resources?
> >     
> >     It seems to me that we have the original logic in place for a reason. Is it because we want the master to cache the resource provider infos without any resource for a reason? If yes, we may want to revisit  this and think about if we want to erase it, or keep the original behavior but just clean up the resources/operations in the master.

Fixed the comment.

This only handles the case were we successfully transported a `DISCONNECT` even to the master, but if e.g., the slave never observed it (e.g., RP doesn't come back after agent failover) we wouldn't send this.

AFAIR we added the caching behavior to the master because we thought it would be useful for clients to have a single point where they could get all RP-related information. I don't think that turned out to be very useful, and also always violated the encapsulation we had in mind for LRPs. I'd suggest we carry out the agent-related changes in this patch and let the master decide independently what to GC and what not to GC, e.g., in https://reviews.apache.org/r/69337/.

Dropping for now; feel free to reopen.


- Benjamin


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


On Dec. 13, 2018, 2:51 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2018, 2:51 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
>   src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review211106
-----------------------------------------------------------




src/slave/slave.cpp
Line 7595 (original), 7598 (patched)
<https://reviews.apache.org/r/69338/#comment296035>

    It seems to me that the compiler should be able to hoist `message.mutable_resource_providers()` outside the loop so there is no need to do it manually. But I'm fine with this change.



src/slave/slave.cpp
Lines 7873-7874 (original), 7875-7876 (patched)
<https://reviews.apache.org/r/69338/#comment296036>

    These comments need to be updated.
    
    I was wondering now that, since we already have this empty resource logic here, why do we still see stale resource in the master? Is it because that in the case of agent restart, no `DISCONNECT` message is triggered, and thus we never clean up the resources?
    
    It seems to me that we have the original logic in place for a reason. Is it because we want the master to cache the resource provider infos without any resource for a reason? If yes, we may want to revisit  this and think about if we want to erase it, or keep the original behavior but just clean up the resources/operations in the master.


- Chun-Hung Hsiao


On Nov. 14, 2018, 2:36 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2018, 2:36 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb 
>   src/tests/resource_provider_manager_tests.cpp 5bb740edc7c3cc8698aede4f2ed57c21232fe378 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/1/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review211336
-----------------------------------------------------------



PASS: Mesos patch 69338 was successfully built and tested.

Reviews applied: `['69337', '69338']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2709/mesos-review-69338

- Mesos Reviewbot Windows


On Dec. 14, 2018, 3:56 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Dec. 14, 2018, 3:56 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
>   src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/3/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/
-----------------------------------------------------------

(Updated Dec. 14, 2018, 4:56 p.m.)


Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.


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


Repository: mesos


Description
-------

This patch changes the agent to not report disconnected resource
providers in the `UpdateSlaveMessage` it emits. We also fix how it
generates resource provider-related updates when no resource providers
are connected to allow the master to react properly when a resource
provider disappears.


Diffs (updated)
-----

  src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
  src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 


Diff: https://reviews.apache.org/r/69338/diff/3/

Changes: https://reviews.apache.org/r/69338/diff/2-3/


Testing
-------

`make check`


Thanks,

Benjamin Bannier


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review211322
-----------------------------------------------------------



Patch looks great!

Reviews applied: [69337, 69338]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On Dec. 13, 2018, 1:51 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2018, 1:51 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
>   src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review211312
-----------------------------------------------------------


Fix it, then Ship it!





src/slave/slave.cpp
Lines 7664 (patched)
<https://reviews.apache.org/r/69338/#comment296300>

    Can you add a comment for `UpdateSlaveMessage.resource_providers` in `src/messages/messages.proto`, e.g.,
    ```
    If not set, it means that the resource providers on this agent remain unchanged.
    ```
    And maybe add a corresonding comment in `src/master/master.cpp`, like here:
    https://reviews.apache.org/r/69337/#comment296301
    
    Also, there's a typo ("resoruces") in the comment of `update_oversubscribed_resources`.



src/slave/slave.cpp
Line 7592 (original), 7671 (patched)
<https://reviews.apache.org/r/69338/#comment296299>

    s/informat on/information/ ;)


- Chun-Hung Hsiao


On Dec. 13, 2018, 1:51 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2018, 1:51 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
>   src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/#review211292
-----------------------------------------------------------



FAIL: Some of the unit tests failed. Please check the relevant logs.

Reviews applied: `['69337', '69338']`

Failed command: `Start-MesosCITesting`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2702/mesos-review-69338

Relevant logs:

- [mesos-tests.log](http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2702/mesos-review-69338/logs/mesos-tests.log):

```
W1213 15:02:17.991708 10660 slave.cpp:3933] Ignoring shutdown framework 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-0000 because it is terminating
I1213 15:02:17.993702 11072 master.cpp:1275] Agent 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-S0 at slave(462)@192.10.1.4:55481 (windows-01.chtsmhjxogyevckjfayqqcnjda.xx.internal.cloudapp.net) disconnected
I1213 15:02:17.993702 11072 master.cpp:3278] Disconnecting agent 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-S0 at slave(462)@192.10.1.4:55481 (windows-01.chtsmhjxogyevckjfayqqcnjda.xx.internal.cloudapp.net)
I1213 15:02:17.993702 11072 master.cpp:3297] Deactivating agent 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-S0 at slave(462)@192.10.1.4:55481 (windows-01.chtsmhjxogyevckjfayqqcnjda.xx.internal.cloudapp.net)
I1213 15:02:17.994699 12564 hierarchical.cpp:357] Removed framework 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-0000
I1213 15:02:17.994699 12564 hierarchical.cpp:801] Agent 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-S0 deactivated
I1213 15:02:17.995751 11908 containerizer.cpp:2463] Destroying container 905f165e-a1fe-4002-852b-b16b71a77686 in RUNNING state
I1213 15:02:17.995751 11908 containerizer.cpp:3130] Transitioning the state of container 905f165e-a1fe-4002-852b-b16b71a77686 from RUNNING to DESTROYING
I1213 15:02:17.995751 11908 launcher.cpp:161] Asked to destroy container 905f165e-a1fe-4002-852b-b16b71a77686
W1213 15:02:17.996817 10948 process.cpp:1423] Failed to recv on socket WindowsFD::Type::SOCKET=968 to peer '192.10.1.4:57292': IO failed with error code: The specified network name is no longer availabl[       OK ] IsolationFlag/MemoryIsolatorTest.ROOT_MemUsage/0 (685 ms)
[----------] 1 test from IsolationFlag/MemoryIsolatorTest (704 ms total)

[----------] Global test environment tear-down
[==========] 1058 tests from 104 test cases ran. (534532 ms total)
[  PASSED  ] 1057 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] DockerFetcherPluginTest.INTERNET_CURL_InvokeFetchByName

 1 FAILED TEST
  YOU HAVE 231 DISABLED TESTS

e.

W1213 15:02:17.997750 10948 process.cpp:838] Failed to recv on socket WindowsFD::Type::SOCKET=3024 to peer '192.10.1.4:57293': IO failed with error code: The specified network name is no longer available.

I1213 15:02:18.075950 11072 containerizer.cpp:2969] Container 905f165e-a1fe-4002-852b-b16b71a77686 has exited
I1213 15:02:18.106967  4880 master.cpp:1117] Master terminating
I1213 15:02:18.107952 11072 hierarchical.cpp:643] Removed agent 5ed9f56e-9413-41a6-89e2-4af2fd801c3c-S0
I1213 15:02:18.387962 10948 process.cpp:927] Stopped the socket accept loop
```

- Mesos Reviewbot Windows


On Dec. 13, 2018, 1:51 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69338/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2018, 1:51 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
> 
> 
> Bugs: MESOS-9384
>     https://issues.apache.org/jira/browse/MESOS-9384
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes the agent to not report disconnected resource
> providers in the `UpdateSlaveMessage` it emits. We also fix how it
> generates resource provider-related updates when no resource providers
> are connected to allow the master to react properly when a resource
> provider disappears.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
>   src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 
> 
> 
> Diff: https://reviews.apache.org/r/69338/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Re: Review Request 69338: Change agent to not report disconnected resource providers.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69338/
-----------------------------------------------------------

(Updated Dec. 13, 2018, 2:51 p.m.)


Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.


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


Repository: mesos


Description
-------

This patch changes the agent to not report disconnected resource
providers in the `UpdateSlaveMessage` it emits. We also fix how it
generates resource provider-related updates when no resource providers
are connected to allow the master to react properly when a resource
provider disappears.


Diffs (updated)
-----

  src/slave/slave.cpp 8467a60ad84a4e900c2eb587fdf2fc6ff9c72c54 
  src/tests/resource_provider_manager_tests.cpp b61c50f839b7a0f49a781a6f44aa4f10ad7ebafe 


Diff: https://reviews.apache.org/r/69338/diff/2/

Changes: https://reviews.apache.org/r/69338/diff/1-2/


Testing
-------

`make check`


Thanks,

Benjamin Bannier