aurora.git
2 months agoUpdating .auroraversion to release version 0.20.0. rel/0.20.0
Renan DelValle [Tue, 3 Apr 2018 22:42:14 +0000 (15:42 -0700)] 
Updating .auroraversion to release version 0.20.0.

2 months agoUpdating .auroraversion to 0.20.0-rc1. rel/0.20.0-rc1
Renan DelValle [Wed, 28 Mar 2018 19:20:05 +0000 (12:20 -0700)] 
Updating .auroraversion to 0.20.0-rc1.

2 months agoIncrementing snapshot version to 0.21.0-SNAPSHOT.
Renan DelValle [Wed, 28 Mar 2018 19:20:05 +0000 (12:20 -0700)] 
Incrementing snapshot version to 0.21.0-SNAPSHOT.

2 months agoUpdating CHANGELOG for 0.20.0 release.
Renan DelValle [Wed, 28 Mar 2018 19:20:05 +0000 (12:20 -0700)] 
Updating CHANGELOG for 0.20.0 release.

2 months agoPreparing RELEASE-NOTES.md for release.
Renan DelValle [Wed, 28 Mar 2018 19:15:39 +0000 (12:15 -0700)] 
Preparing RELEASE-NOTES.md for release.

2 months agoReverting changes done by release script due to failed
Renan DelValle [Tue, 27 Mar 2018 21:18:22 +0000 (14:18 -0700)] 
Reverting changes done by release script due to failed
vote for 0.20.0 RC0

Revert "Preparing RELEASE-NOTES.md for release."

This reverts commit a60367626e71786fa7a23a49510a437986a9a074.

Revert "Updating CHANGELOG for 0.20.0 release."

This reverts commit 5a26413f72b8a428f286bed286aa4612c4123884.

Revert "Incrementing snapshot version to 0.21.0-SNAPSHOT."

This reverts commit a12b84444e0ba4227e6a41b0f7e82045b2dcc016.

2 months agoEnd to end tests bugfix
Renan DelValle [Tue, 27 Mar 2018 21:12:16 +0000 (14:12 -0700)] 
End to end tests bugfix

* Fixing kerberos end to end test. Previous version had it's signing key revoked resulting in the test failing.

* Excluding kerberos unit file from being copied on provision as it's later copied and deleted by the end to end test.

* Bypass leader redirect changed from upstart to systemd. This test wasn't being run because the kerberos test was failing.

* Changing docker image to slim-stretch in docker aurora tests to address AURORA-1974.

* Added daemon-reload to aurorabuild whenever the daemons are restarted.

Bugs closed: AURORA-1974

Reviewed at https://reviews.apache.org/r/66269/

2 months agoIntroduce mesos disk collector
Reza Motamedi [Mon, 26 Mar 2018 20:47:13 +0000 (13:47 -0700)] 
Introduce mesos disk collector

When disk isolation is enabled in a Mesos agent it calculates the disk usage for each container.
Thermos Observer also monitors disk usage using `twitter.common.dirutil`, essentially repeating the work already done by the agent. In practice, we see that disk monitoring is one of the most expensive resource monitoring tasks. For instance, when there are deeply nested directories, the CPU utilization of the observer process can easily reach 1.5 CPUs. It would be ideal if we delegate the disk monitoring task to the agent and do it only once. With this approach, when disk collection has improved in the agent (for instance by implementing XFS isolation), we can simply benefit from it without any code change. Some more information about the problem is provided in AURORA-1918.

This patch that introduces `MesosDiskCollector` which queries the agent's API endpoint to lookup disk_used_bytes. Note that there is also resource monitoring in thermos executor. Currently, I left the disk collector there to use the `du` implementation. That can be changed in a later patch.

I modified some vagrant config files including `aurora-executor.service` and `etc_mesos-slave/isolation` for testing. They can be left as is. I included them in this patch to show how this would work e2e.

Testing Done:
- I added unit tests.
- Tested in vagrant and it works as intenced.
- I also built and deployed in our test enviroment. In order to measure imporoved performance I created jobs with nested folders and noticed reduction in CPU utilization of the Observer process, by at least 60%. (1.5 CPU cores to 0.4 CPU cores)

Here is one specific test setup: On two hosts I created a two tasks. Each task creates identical nested directory structures and files in them. The overall size is 30GB. test_host_1 runs the current version of observer and test_host_2 runs Observer with this patch and also has mesos_disk_collection enabled. The results are as follows:

```
rezam[7]TEST_HOST_1 ~ $ while true; do echo `date`; curl localhost:1338/vars -s | grep cpu; sleep 10; done
Thu Mar 22 04:36:17 UTC 2018
observer.observer_cpu 108.9
Thu Mar 22 04:36:27 UTC 2018
observer.observer_cpu 123.2
Thu Mar 22 04:36:38 UTC 2018
observer.observer_cpu 123.2
Thu Mar 22 04:36:48 UTC 2018
observer.observer_cpu 123.2
Thu Mar 22 04:36:58 UTC 2018
observer.observer_cpu 111.0
Thu Mar 22 04:37:08 UTC 2018
observer.observer_cpu 111.0
Thu Mar 22 04:37:18 UTC 2018
observer.observer_cpu 111.0

rezam[7]TEST_HOST_2 ~ $ while true; do echo `date`; curl localhost:1338/vars -s | grep cpu; sleep 10; done
Thu Mar 22 04:36:20 UTC 2018
observer.observer_cpu 1.3
Thu Mar 22 04:36:30 UTC 2018
observer.observer_cpu 1.3
Thu Mar 22 04:36:40 UTC 2018
observer.observer_cpu 1.3
Thu Mar 22 04:36:50 UTC 2018
observer.observer_cpu 1.2
Thu Mar 22 04:37:00 UTC 2018
observer.observer_cpu 1.2
Thu Mar 22 04:37:10 UTC 2018
observer.observer_cpu 1.2
Thu Mar 22 04:37:20 UTC 2018
observer.observer_cpu 1.8
```

Reviewed at https://reviews.apache.org/r/66103/

3 months agoFix 'PreemptorSlotSearchBenchmark', remove 'isProduction' references in benchmark
Jordan Ly [Fri, 23 Mar 2018 20:30:41 +0000 (13:30 -0700)] 
Fix 'PreemptorSlotSearchBenchmark', remove 'isProduction' references in benchmark

This benchmark was using the deprecated `production` flag when building
the tasks for the cluster. `PendingTaskProcessor` depends on `tier`
instead, so this benchmark ended up not testing the correct codepath.

Removed references to `production` and added `tier` instead.
Additionally, removed some unused options.

Reviewed at https://reviews.apache.org/r/66190/

3 months agoRemove unused LOST_LOCK_MESSAGE variable in JobUpdateControllerImpl
Jordan Ly [Fri, 23 Mar 2018 17:13:30 +0000 (10:13 -0700)] 
Remove unused LOST_LOCK_MESSAGE variable in JobUpdateControllerImpl

We no longer use locks for updates (context: https://reviews.apache.org/r/63130/). This was a legacy variable.

Reviewed at https://reviews.apache.org/r/66199/

3 months agoAdding support for using custom executors via the Aurora DSL
Renan DelValle [Wed, 21 Mar 2018 01:26:49 +0000 (18:26 -0700)] 
Adding support for using custom executors via the Aurora DSL

Bugs closed: AURORA-1981

Reviewed at https://reviews.apache.org/r/66154/

3 months agoSwitch Thermos to lazy log formatting
Stephan Erb [Mon, 19 Mar 2018 09:10:03 +0000 (09:10 +0000)] 
Switch Thermos to lazy log formatting

This is the first part of a small series of Thermos observer performance
improvements.

As a first iteration, this switches all logging to use the logger-embedded
formatting rather than doing it eager up front. This has the advantage that
we produce less garbage if debug logging is disabled.

Reviewed at https://reviews.apache.org/r/66136/

3 months agoPersist scheduler/observer logs to /var/log/aurora/[FILE].log
Jordan Ly [Mon, 19 Mar 2018 20:58:29 +0000 (13:58 -0700)] 
Persist scheduler/observer logs to /var/log/aurora/[FILE].log

`journalctl -u aurora-[executor|scheduler]` still works.

Reviewed at https://reviews.apache.org/r/65896/

3 months agoRemove unused module in RecoveryTool, move TaskTestUtil to test folder
Jordan Ly [Mon, 19 Mar 2018 17:07:30 +0000 (10:07 -0700)] 
Remove unused module in RecoveryTool, move TaskTestUtil to test folder

Removing an unused `TierModule` from `RecoveryTool`.

Additionally, resolved an old TODO and moved `TaskTestUtil` to the test folder.
It seems that the old version of JMH could not see test sources but
https://github.com/melix/jmh-gradle-plugin/issues/31 and the upgrade to 0.4.4
seems to fix that.

Reviewed at https://reviews.apache.org/r/65769/

3 months agoRefactor ClusterState to more appropriate package, move binding to StateModule
Jordan Ly [Sun, 18 Mar 2018 05:00:21 +0000 (22:00 -0700)] 
Refactor ClusterState to more appropriate package, move binding to StateModule

Browsing through the code and I noticed that if preemption is turned off, the
`/state` endpoint will not work since `ClusterState` is not bound.

I moved `ClusterState` and `ClusterStateImpl` to a more suitable package, and
bind `ClusterState` in `StateModule` no matter what.

Reviewed at https://reviews.apache.org/r/66074/

3 months agoUpgrade RBT to 0.7.11
Renan DelValle [Fri, 16 Mar 2018 17:40:48 +0000 (10:40 -0700)] 
Upgrade RBT to 0.7.11

Reviewed at https://reviews.apache.org/r/65873/

3 months agoIncrementing snapshot version to 0.21.0-SNAPSHOT.
Renan DelValle [Fri, 2 Mar 2018 00:35:48 +0000 (16:35 -0800)] 
Incrementing snapshot version to 0.21.0-SNAPSHOT.

3 months agoUpdating CHANGELOG for 0.20.0 release.
Renan DelValle [Fri, 2 Mar 2018 00:35:48 +0000 (16:35 -0800)] 
Updating CHANGELOG for 0.20.0 release.

3 months agoPreparing RELEASE-NOTES.md for release.
Renan DelValle [Fri, 2 Mar 2018 00:31:48 +0000 (16:31 -0800)] 
Preparing RELEASE-NOTES.md for release.

3 months agoUse StandardCharset instead of Charset.forName in ApiModule
Jordan Ly [Wed, 28 Feb 2018 18:41:32 +0000 (10:41 -0800)] 
Use StandardCharset instead of Charset.forName in ApiModule

Minor nit, use the StandardCharset constant for UTF-8 as opposed to creating it ourselves.

Reviewed at https://reviews.apache.org/r/65761/

3 months agoRevert "Fix cron id collision bug by avoiding state in Quartz jobs"
Jordan Ly [Tue, 27 Feb 2018 18:18:46 +0000 (10:18 -0800)] 
Revert "Fix cron id collision bug by avoiding state in Quartz jobs"

This reverts commit e2ea191473397691605602c6e40c6aad8a56d81a.

A bug was found where jobs that were killed via the KILL_EXISTING flag would set `path` as `null` in
`JobDataMap` that would block concurrent runs, but that value would never be set to `key` after the
the delayed run finished because it would run outside of the `Job` execution.

The issue in https://reviews.apache.org/r/65680/ will occur again, but it is rare and has been
around for a few years.

This bug was not caught in the unit test `testKillExisting` because `executeWithReplay` is mocked
and runs synchronously within the `Job` execution, allowing the `key` to be persisted.

Reviewed at https://reviews.apache.org/r/65810/

4 months agoAdd GPUs as resources in the Aurora CLI.
Franck Cuny [Wed, 21 Feb 2018 18:55:41 +0000 (10:55 -0800)] 
Add GPUs as resources in the Aurora CLI.

Reviewed at https://reviews.apache.org/r/65735/

4 months agoUpgrading Vagrant setup from Ubuntu Trusty to Ubuntu Xenial.
Renan DelValle [Wed, 21 Feb 2018 17:43:45 +0000 (09:43 -0800)] 
Upgrading Vagrant setup from Ubuntu Trusty to Ubuntu Xenial.

Deleted Thrift install from build script as it's no longer needed.

Changing docker images in e2e tests from Debian Jessie to Debian Stretch for ABI compatibility.

Bugs closed: AURORA-1964

Reviewed at https://reviews.apache.org/r/65565/

4 months agoFix cron id collision bug by avoiding state in Quartz jobs
Jordan Ly [Tue, 20 Feb 2018 05:33:21 +0000 (21:33 -0800)] 
Fix cron id collision bug by avoiding state in Quartz jobs

There is a pretty rare situation that can occur that will cause the scheduler to crash.

The steps are:

1. Schedule and start a cron (runs every minute, graceful shutdown period
   > 1 minute)
2. Perform 2 runs of the cron
3. Deschedule the cron
4. Reschedule the cron
5. Perform 3 runs of the cron
6. Scheduler will crash on the 3rd run due to an ID collision between the already running cron and
a new cron trying to start

The reason for this bug is that some state is persisted between cron
scheduling/descheduling via `killFollowups`. We use Quartz `JobDataMap` to hold a "work in progress"
token, while the `killFollowups` set indicates "completion" in order to ensure there are no
concurrent runs. Descheduling a cron will remove the "work in progress" token while ignoring the
"completion" token in `killFollowups`. Later, a "work in progress" token may be added and
a "completion" token may be seen mistakenly from a previous schedule, causing a concurrent run.

For the example above, the runs in step 2 will add the key to the set to show that all runs are
finished and another run can start. The 3rd run in step
5 will mistakenly see that the 2nd run has started and finished since the "completion" token was
preserved from the first set of runs in step 2. This will erroneously trigger a concurrent run
causing a ID collision.

We should not preserve any state between cron scheduling/descheduling outside of the given Quartz
`JobDataMap` abstraction. We can use the presence of a value here to achieve the same thing as
`killFollowups`.

Reviewed at https://reviews.apache.org/r/65680/

4 months agoMake charset parsing in HTTP headers case insensitve
Jordan Ly [Mon, 19 Feb 2018 07:26:15 +0000 (23:26 -0800)] 
Make charset parsing in HTTP headers case insensitve

Users have reported that the UI does not load in Firefox. Investigating the issue shows that Chrome
and Safari will format charset into an uppercase `UTF-8` which is accepted by the servlet. However,
Mozilla will leave the charset as lowercase `utf-8` which causes a 415 response.

Charsets should be case-insensitive but the default Java `MediaType` class does not take this into
account when parsing/comparing. I propose switching to Guava's `MediaType` class which does smarter
comparisons.

Reviewed at https://reviews.apache.org/r/65690/

4 months agoDisable pytest-fast mode as a workaround for failing health checker tests.
Stephan Erb [Thu, 15 Feb 2018 19:19:28 +0000 (11:19 -0800)] 
Disable pytest-fast mode as a workaround for failing health checker tests.

Bugs closed: AURORA-1972

Reviewed at https://reviews.apache.org/r/65598/

4 months agoDo not reschedule a PARTITIONED task if it was in KILLING state.
David McLaughlin [Wed, 14 Feb 2018 19:18:31 +0000 (11:18 -0800)] 
Do not reschedule a PARTITIONED task if it was in KILLING state.

Reviewed at https://reviews.apache.org/r/65648/

4 months agoAdd GPG key for jordanly@apache.org
Jordan Ly [Wed, 14 Feb 2018 18:50:36 +0000 (10:50 -0800)] 
Add GPG key for jordanly@apache.org

Reviewed at https://reviews.apache.org/r/65650/

4 months agoAdding support for Thrift JSON requests which defines UTF-8 as the charset for the...
Renan DelValle [Wed, 14 Feb 2018 16:28:52 +0000 (08:28 -0800)] 
Adding support for Thrift JSON requests which defines UTF-8 as the charset for the Content-Type in the Request Headers

This fixes the current UI brakage as Thrift is incorrectly rejected by the scheduler servlet as an unsupported media type.

Test added to prevent regressions.

Reviewed at https://reviews.apache.org/r/65649/

4 months agoUpdate Javascript Thrift to 0.10
Stephan Erb [Fri, 9 Feb 2018 15:10:53 +0000 (15:10 +0000)] 
Update Javascript Thrift to 0.10

We missed this change when bumping the Thrift version used by Python and
Java. https://reviews.apache.org/r/64290/

List of changes: https://github.com/apache/thrift/commits/master/lib/js/src/thrift.js

Reviewed at https://reviews.apache.org/r/65433/

4 months agoUse overflow to prevent overlapping config summary tables
David McLaughlin [Tue, 6 Feb 2018 22:13:14 +0000 (14:13 -0800)] 
Use overflow to prevent overlapping config summary tables

Previous approach seemed almost random with the way it used line breaks for words. Caused some weirdness for edge cases. This approach just caps the size of table cells, since only metadata can grow unbounded.

Reviewed at https://reviews.apache.org/r/65537/

4 months agoAdd task page to Scheduler UI (without inbound links yet - this is for external refer...
David McLaughlin [Tue, 6 Feb 2018 01:26:11 +0000 (17:26 -0800)] 
Add task page to Scheduler UI (without inbound links yet - this is for external referencing).

Reviewed at https://reviews.apache.org/r/65494/

4 months agoShow cron job preview when no active tasks.
David McLaughlin [Mon, 5 Feb 2018 18:13:01 +0000 (10:13 -0800)] 
Show cron job preview when no active tasks.

Reviewed at https://reviews.apache.org/r/65501/

4 months agoAdding gpg key for renan
Renan DelValle [Sat, 3 Feb 2018 20:25:40 +0000 (12:25 -0800)] 
Adding gpg key for renan

Reviewed at https://reviews.apache.org/r/65488/

4 months agoFix UI table layout issue on Config Summaries
David McLaughlin [Fri, 2 Feb 2018 18:52:45 +0000 (10:52 -0800)] 
Fix UI table layout issue on Config Summaries

Reviewed at https://reviews.apache.org/r/65477/

4 months agoAdd PartitionPolicy to config summary when defined
David McLaughlin [Fri, 2 Feb 2018 18:05:04 +0000 (10:05 -0800)] 
Add PartitionPolicy to config summary when defined

Reviewed at https://reviews.apache.org/r/65476/

4 months agoEnsure primary_port warning respects announcer portmap
Stephan Erb [Wed, 31 Jan 2018 21:25:57 +0000 (21:25 +0000)] 
Ensure primary_port warning respects announcer portmap

This eliminates false-positive warnings in the client: It used to complain
about unbound primary ports if those where bound via the portmap.

Bugs closed: AURORA-1233

Reviewed at https://reviews.apache.org/r/65434/

4 months agoImprove performance of MemTaskStore queries
Bill Farner [Wed, 31 Jan 2018 22:59:30 +0000 (14:59 -0800)] 
Improve performance of MemTaskStore queries

Use `ArrayDeque` rather than `HashSet` for fetchTasks, and use imperative style
rather than functional.  I arrived at this result after running benchmarks with
some of the other usual suspects (`ArrayList`, `LinkedList`).

This patch also enables stack and heap profilers in jmh (more details
[here](http://hg.openjdk.java.net/codetools/jmh/file/25d8b2695bac/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java)),
providing insight into the heap impact of changes.  I started this change with a
heap profiler as the primary motivation, and ended up using it to guide this
improvement.

Reviewed at https://reviews.apache.org/r/65303/

4 months agoSupport PARTITIONED state in SLA calculations. Also added a test to protect against...
David McLaughlin [Tue, 30 Jan 2018 22:06:39 +0000 (14:06 -0800)] 
Support PARTITIONED state in SLA calculations. Also added a test to protect against this test failing in the future.

Reviewed at https://reviews.apache.org/r/65281/

4 months agoFix infinite loop in Task State Machine due to TASK_UNKNOWN handling
David McLaughlin [Tue, 30 Jan 2018 22:02:09 +0000 (14:02 -0800)] 
Fix infinite loop in Task State Machine due to TASK_UNKNOWN handling

This patch cleans up the logic. The two main changes:

1) Do not allow ASSIGNED -> PARTITIONED. This is not really related to this bug, but I found this logic error during debugging. ASSIGNED is a transient state and is subject to the transient task timeout in the Scheduler, so we should not attempt to move to PARTITIONED during that window.
2) Do not try to kill tasks we think are terminal when Mesos tells us they are unknown. Originally we did this because "manageTerminalTasks" is also used for restarting tasks - but in both cases it never makes sense to respond  to "I don't know about that task" with a request to kill it.

Bugs closed: AURORA-1966

Reviewed at https://reviews.apache.org/r/65339/

4 months agoFix error handling logic for launch failures
David McLaughlin [Thu, 25 Jan 2018 18:50:45 +0000 (10:50 -0800)] 
Fix error handling logic for launch failures

Bugs closed: AURORA-1965

Reviewed at https://reviews.apache.org/r/65338/

5 months agoAllow for injection of custom OfferSets, removed OfferOrder and OfferSelector
Jordan Ly [Sat, 20 Jan 2018 10:27:54 +0000 (11:27 +0100)] 
Allow for injection of custom OfferSets, removed OfferOrder and OfferSelector

The goal of this patch is to provide a more reasonable abstraction for custom
scheduling.

Currently, we have `OfferSelector`, `OfferOrder`, and recently I proposed
`FilterableOfferCollection` (https://reviews.apache.org/r/65225/). These were
all created in order to provide more customization within the scheduling loop.
However, they suffer from being leaky and too disparate. This patch hopes to
combine all of those components into a single `OfferSet` which can be injected
and used by HostOffers. This interface allows for custom scheduling logic to
be co-located with custom data structures for `offers` as opposed to being
passed around as different components.

The following options will be removed from the last 0.19 to now:
```
-offer_order_modules
```

Reviewed at https://reviews.apache.org/r/65233/

5 months agoPrint command line parameters when the scheduler starts
Bill Farner [Fri, 19 Jan 2018 04:51:42 +0000 (20:51 -0800)] 
Print command line parameters when the scheduler starts

Realized i never added this in the command line parser change.
Note that this output differs from the original code in one important
way - it uses `toString()` on the parameter type rather than printing
the raw value from the command line.  Unfortunately jcommander does not
make that possible.  `shiro_ini_path` is one example of an arg that
would ideally print differently here.

Reviewed at https://reviews.apache.org/r/65234/

5 months agoGitHub Pull Request template to discourage folks from making PRs
Renan DelValle [Fri, 19 Jan 2018 03:29:40 +0000 (19:29 -0800)] 
GitHub Pull Request template to discourage folks from making PRs

Simple pull request template encouraging potential contributors
to submit via ReviewBoard instead of opening up a PR on GitHub.

Normally I wouldn't want to add something to the repo that is
platform specific, but given the fact that we have a lot of exposure
on GitHub and that there's no way to disallow PRs, it might be a
good idea to point potential contributors in the right direction
from the get go.

Reviewed at https://reviews.apache.org/r/65222/

5 months agoAdded ExclusionStrategy to Gson formatter in structdump
Juan Manuel Fresia [Wed, 17 Jan 2018 23:02:26 +0000 (15:02 -0800)] 
Added ExclusionStrategy to Gson formatter in structdump

This hides thrift metadata fields such as "__isset_bitfield"
and the "optionals" enum.
Added a FieldNamingStrategy to rename "value_" and "setName_"
fields to "value" and "key" on map formatting.

Reviewed at https://reviews.apache.org/r/65076/

5 months agoUpdate discovery info documentation, when using mesos-dns
Ruben D. Porras [Wed, 10 Jan 2018 13:39:27 +0000 (14:39 +0100)] 
Update discovery info documentation, when using mesos-dns

Reviewed at https://reviews.apache.org/r/65068/

5 months agoRefactor scheduling code to split matching and assigning phases
Bill Farner [Tue, 9 Jan 2018 22:50:51 +0000 (14:50 -0800)] 
Refactor scheduling code to split matching and assigning phases

This patch sets the stage for performing the bulk of scheduling work in a
separate call path, without holding the write lock.

Also included is a mechanical refactor pushing the `revocable` flag into
`ResourceRequest` (which was ~always needed as a sibling parameter).

Reviewed at https://reviews.apache.org/r/64954/

5 months agoCustom converter to allow the -thermos_executor_resources
Renan DelValle [Tue, 9 Jan 2018 21:27:28 +0000 (13:27 -0800)] 
Custom converter to allow the -thermos_executor_resources
flag to take an empty string and parse it to an empty list

Fixes the issue that caused the voting to fail for the 0.19.0 Aurora packages.
Fix cribbed from: https://github.com/cbeust/jcommander/pull/422
Implemented as a custom converter as suggested here:
https://reviews.apache.org/r/64824/

Reviewed at https://reviews.apache.org/r/64934/

5 months agoAdd a test to detect incompatible storage changes
Bill Farner [Thu, 4 Jan 2018 16:02:55 +0000 (08:02 -0800)] 
Add a test to detect incompatible storage changes

This is intended as a safeguard against future compatibility regressions like
[AURORA-1959](https://issues.apache.org/jira/browse/AURORA-1959).

I approached this with a few goals:

  - golden files should be text-based and human-readable.  This allows for
    non-opaque code reviews, and simpler remedy when it's necessary to update
    the goldens (i.e. copy-pasteable)
  - guidance for schema evolution should be included directly in test failures
  - separate detection of 'what the scheduler _can_ read' and 'what the
    scheduler writes'
  - reasonably-complete schema coverage with minimal manual labor.  These tests
    auto-generate structs to mitigate maintenance burden of test code as
    schemas evolve.

This is not a replacement for vigilance with data compatibility, but it should
at least

1. mitigate unintentional breakages in compatibility, especially for new
   contributors
2. draw code reviewer attention to compatibility changes in a patch (signaled by
   changes to golden files)

Reviewed at https://reviews.apache.org/r/64519/

6 months agoAdd metadata field to Job object in DSL
Jing Chen [Sun, 17 Dec 2017 16:26:33 +0000 (08:26 -0800)] 
Add metadata field to Job object in DSL

Bugs closed: AURORA-1898

Reviewed at https://reviews.apache.org/r/64341/

6 months agoAdd a storage recovery tool
Bill Farner [Fri, 15 Dec 2017 20:07:37 +0000 (12:07 -0800)] 
Add a storage recovery tool

This tool was originally intended as a migration path between Persistence
backends.  As it turns out, the model also works well for recovering from a
backup.

I propose we drop our current recovery mechanism to use this tool.  The existing
recovery-via-scheduler-rpc is slightly non-sensical, as it assumes a healthy
scheduler.  When an operator decides it is necessary to recover from a backup,
we should assume the scheduler state may be broken.  Furthermore, starting an
empty scheduler to bootstrap can have undesirable effects such as advertising
false state to clients and establishing a new empty framework with the master.

Testing Done:
end-to-end tests pass (and exercise recovery tool)

Reviewed at https://reviews.apache.org/r/64625/

6 months agoUse java.util.Optional throughout
Bill Farner [Fri, 15 Dec 2017 20:01:49 +0000 (12:01 -0800)] 
Use java.util.Optional throughout

Reviewed at https://reviews.apache.org/r/64629/

6 months agoRecover snapshots via the Op stream
Bill Farner [Thu, 14 Dec 2017 04:37:57 +0000 (20:37 -0800)] 
Recover snapshots via the Op stream

This cleans up the various interfaces around persisting and recovering from
`Snapshot`s.  Most importantly, `LogPersistence` no longer bypasses the
`recover()` `Op` stream to apply snapshots.  As a result, it should be
straightforward to build a migration utility that clones `LogPersistence`
state into another `Persistence` implementation.

Reviewed at https://reviews.apache.org/r/64286/

6 months agoUpdate to Thrift 0.10.0 (https://github.com/apache/thrift/blob/master/CHANGES)
John Sirois [Wed, 13 Dec 2017 04:59:47 +0000 (20:59 -0800)] 
Update to Thrift 0.10.0 (https://github.com/apache/thrift/blob/master/CHANGES)

Included changes:

* Update to the latest pants version. This was necesary to get ./pants gen working.
* The Java hashcode option has been removed as it is now the default.

Testing Done:
```
$ ./build-support/jenkins/build.sh
$ ./src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
```

Reviewed at https://reviews.apache.org/r/64290/

6 months agoAttempt #2 to fix flaky Webhook test
Jordan Ly [Tue, 12 Dec 2017 22:28:59 +0000 (23:28 +0100)] 
Attempt #2 to fix flaky Webhook test

Along the same lines of Stephan's change (https://reviews.apache.org/r/64482/),
but waiting for `onThrowable` to finish since it is called asyncronously to the
future being completed.

Overall, this flakiness has seemed to increase in volume over the past month.
I've been running into it with a noticable fraction of internal/test builds.

Bugs closed: AURORA-1961

Reviewed at https://reviews.apache.org/r/64523/

6 months agoRestore Linux compatibility of review_feedback.py
Stephan Erb [Tue, 12 Dec 2017 11:54:45 +0000 (12:54 +0100)] 
Restore Linux compatibility of review_feedback.py

The "unbuffered" parameter introduced in https://reviews.apache.org/r/64508/
does only work on MacOS.

6 months agoConvert carriage returns to newlines in reviews
Stephan Erb [Tue, 12 Dec 2017 09:06:28 +0000 (10:06 +0100)] 
Convert carriage returns to newlines in reviews

Spotbugs prints multiple lines with \r [1][2]. This looks like a single
line for shell commands but will be converted to multiple lines once
read by Python.

By performing the conversion before the tail command, we will get a
consistent line count in Bash and Python.

[1] https://github.com/spotbugs/spotbugs/blob/fe8a8d66e97d3ae0b830731461aab0f8b39791f6/spotbugs/src/main/java/edu/umd/cs/findbugs/TextUIProgressCallback.java#L103
[2] https://github.com/spotbugs/spotbugs/issues/506

Bugs closed: AURORA-1961

Reviewed at https://reviews.apache.org/r/64508/

6 months agoFix flaky WebhookTest
Stephan Erb [Sun, 10 Dec 2017 11:06:39 +0000 (12:06 +0100)] 
Fix flaky WebhookTest

I opted for a minimal patch that stays close to the style of the other
tests. There is a remaining risk of a race condition if the OS re-uses
the same port between stopping jetty and triggering the webhooks, but
it should be very unlikely.

Reviewed at https://reviews.apache.org/r/64482/

6 months agoUpdate Python deps incl requests and pex
Stephan Erb [Sat, 9 Dec 2017 13:02:46 +0000 (14:02 +0100)] 
Update Python deps incl requests and pex

* Update requests to 2.18.4. The major visible change is that requests
  has un-vendored its dependencies in 2.16.0.
  Details: https://github.com/requests/requests/blob/master/HISTORY.rst

* The usage of a newer urllib3 within requests adds support for
  ipAddress subject alternative name fields in TLS certificates.
  This is relevant in some Aurora scheduler deployments.

* Pex update with various improvements and fixes. The most important
  feature appears to be first-class support for multi-interpreter
  and multi-platform pex construction.
  Details: https://github.com/pantsbuild/pex/blob/master/CHANGES.rst

* Update to latest twitter commons. There are no Aurora related
  fixes in there, but updating does no harm.
  Details: https://github.com/twitter/commons/commits/master

* Regular virtualenv update to the latest version.
  Details: https://virtualenv.pypa.io/en/latest/changes/

Reviewed at https://reviews.apache.org/r/64382/

6 months agoDeprecated Ops re-added, perform no-op instead of throwing an exception.
Jordan Ly [Sat, 9 Dec 2017 02:32:06 +0000 (18:32 -0800)] 
Deprecated Ops re-added, perform no-op instead of throwing an exception.

Bugs closed: AURORA-1959

Reviewed at https://reviews.apache.org/r/64459/

6 months agoRemove hack for guice error logging
Bill Farner [Thu, 7 Dec 2017 18:35:45 +0000 (10:35 -0800)] 
Remove hack for guice error logging

With `103f794ed126e135f2fe0ff1bde04a4093413521`, this hack is no longer needed.

Reviewed at https://reviews.apache.org/r/64426/

6 months agoUpdate to guice 4.1.0, switch from jersey to resteasy
Bill Farner [Thu, 7 Dec 2017 17:50:22 +0000 (09:50 -0800)] 
Update to guice 4.1.0, switch from jersey to resteasy

Upgrading guice was the original goal with this patch, which pulled along
several other dependencies.  Guice 3
[suffers from obscure errors](https://github.com/google/guice/issues/757)
when creating binding error messages with java 8 and lambdas.  This has been a
frequent source of frustration since we first upgraded to java 8 mid-2015.

I've gone spelunking down this path numerous times, and frequently hit a wall
with jersey.  We needed to upgrade jersey-guice, to upgrade jersey, to upgrade
guice.  jersey introduced their own dependency injection (HK2) in jersey 2.0,
which complicated matters.  There have been some promising developments since
(hk2-guice [bridge](https://javaee.github.io/hk2/guice-bridge.html#bi-directional-hk2-guice-bridge),
2.26 [abstracted HK2](https://jersey.github.io/release-notes/2.26.html), and
several [projects](https://github.com/Squarespace/jersey2-guice) have emerged
to solve the issue).  Unfortunately, each avenue failed with some combination
of not working well with our application design, or i just plain couldn't get
it working.  I began to look beyond jersey.

This left restlet and resteasy as the most common alternatives.  I balked early
at restlet due to their guice integration being
[apparently](https://github.com/restlet/restlet-framework-java/commits/master/modules/org.restlet.ext.guice)
[dormant](https://stackoverflow.com/questions/8227583/what-is-the-status-of-org-restlet-ext-guice).

Fortunately i achieved some early wins with resteasy!  Migrating was
straightforward with a small patch based on some examples.

However, i hit a hurdle with shiro-guice.  It
[needed to be updated](https://issues.apache.org/jira/browse/SHIRO-493) to work
with guice 4, and there were some necessary API changes.  No big deal, just the
`filterConfig()` nesting you see in this patch.  This revealed a deeper issue
with binding custom `Filter`s with `ShiroWebModule`.  Previously,
`ShiroWebModule` would effectively only `bind()` keys
[they define](https://github.com/apache/shiro/blob/f326fd3814f672464deb11c3dadadb27af618eec/support/guice/src/main/java/org/apache/shiro/guice/web/ShiroWebModule.java#L65-L86), allowing the API user to `bind()` custom keys.  The [patch](https://github.com/apache/shiro/commit/f2dfa7ff39c9870e7b9856ceca8690c5398080fa#diff-359a7b20d3b7fdcc0ffce11ad57d6e1c) to support guice 4 changed that, and `bind()` will be [called](https://github.com/apache/shiro/commit/f2dfa7ff39c9870e7b9856ceca8690c5398080fa#diff-359a7b20d3b7fdcc0ffce11ad57d6e1cR183)
on these custom keys.  In our case, this caused a duplicate binding.

The simplest workaround to this was to avoid `bind()`ing the custom
`afterAuthFilter` key, and use the custom type as the key type (e.g.
`Key.get(CountingFilter.class)` rather than `Key.get(Filter.class)`).

Lastly, `GuiceResteasyBootstrapServletContextListener` does not integrate with
`GuiceServletContextListener` in the way `GuiceFilter`
[demands](https://github.com/google/guice/blob/e7bef34ef6379735e2a58df1b23f351bb7e30e44/extensions/servlet/src/com/google/inject/servlet/ServletModule.java#L322-L323),
which necessitated the passing of `ServletContext` you see in this patch.

I can't say i'm happy with the outcome here, but i am overall happier given
that guice is upgraded.

Reviewed at https://reviews.apache.org/r/64362/

6 months agoRemove H2-related end-to-end test case
Bill Farner [Wed, 6 Dec 2017 16:58:16 +0000 (08:58 -0800)] 
Remove H2-related end-to-end test case

This test still exercises kerberos functionality through the `snapshot_as`
function, so the h2 test case can safely be considered redundant.

Reviewed at https://reviews.apache.org/r/64377/

6 months agoFix for multiple slf4j jars in intellij
Bill Farner [Wed, 6 Dec 2017 04:47:18 +0000 (20:47 -0800)] 
Fix for multiple slf4j jars in intellij

Testing Done:
`./gradlew idea`, 'External Libraries' no longer has rogue slf4j jars, and
tests don't fail as a result.

Reviewed at https://reviews.apache.org/r/64359/

6 months agoClean up some lint rules
Bill Farner [Mon, 4 Dec 2017 16:08:43 +0000 (08:08 -0800)] 
Clean up some lint rules

Reviewed at https://reviews.apache.org/r/64287/

6 months agoExpose thrift workload stats on pruneTasks() invocations
Jing Chen [Sun, 3 Dec 2017 17:29:20 +0000 (18:29 +0100)] 
Expose thrift workload stats on pruneTasks() invocations

Bugs closed: AURORA-1901

Reviewed at https://reviews.apache.org/r/64284/

6 months agoRemove redundant transaction recorder
Bill Farner [Sun, 3 Dec 2017 14:50:45 +0000 (06:50 -0800)] 
Remove redundant transaction recorder

Reviewed at https://reviews.apache.org/r/64283/

6 months agoExtract a storage Persistence layer
Bill Farner [Sun, 3 Dec 2017 03:59:03 +0000 (19:59 -0800)] 
Extract a storage Persistence layer

This extracts the `Log`- and `Snapshot`-specific details from `LogStorage`,
leaving `DurableStorage`.  `DurableStorage` is useful as a general-purpose
`Storage` mutation observer, with `Persistence` being the minimal behavior
needed for an underlying durability layer to provide.

Reviewed at https://reviews.apache.org/r/64234/

6 months agoMoved `HostOffer` to `offers` package
Jordan Ly [Thu, 30 Nov 2017 22:30:34 +0000 (23:30 +0100)] 
Moved `HostOffer` to `offers` package

Small refactor, I think it fits better here as opposed to the top-level package.

Reviewed at https://reviews.apache.org/r/64190/

6 months agoAdd RemoveJobUpdates log Op, slim JobUpdateStore API
Bill Farner [Wed, 29 Nov 2017 00:58:47 +0000 (16:58 -0800)] 
Add RemoveJobUpdates log Op, slim JobUpdateStore API

JobUpdateStore historically had granular APIs in the storage layer to
minimize unnecessary use of 'expensive' database objects.  The
in-memory store makes these 'free', so moving business logic out of
the storage layer is now feasible for performance and pragmatic.

This patch also introduces the `RemoveJobUpdates` log `Op`, and
`PruneJobUpdateHistory` is now ignored.  In a future release (and possibly
before, with a feature flag), the scheduler will write `RemoveJobUpdates`
to the log.

LogStorage has always had the fundamental expectation that `Op`s are
idempotent.  The job update event `Op`s arguably violate this requirement, but
at minimum, explicit removal of updates is necessary for idempotency.

From LogStorage.java:

    This design implies that all mutations must be idempotent and free from
    constraint and thus replayable over newer operations when recovering
    from an old checkpoint.

Reviewed at https://reviews.apache.org/r/63884/

6 months agoEnable custom offer scoring modules for task assignment
Jordan Ly [Tue, 28 Nov 2017 19:02:14 +0000 (11:02 -0800)] 
Enable custom offer scoring modules for task assignment

Major portions of the refactor:

* Refactor `OfferManager` to do filtering of offers (added `getMatching` and
  `getAllMatching` methods) as opposed to TaskAssigner
* Refactor `TaskAssigner`, allow for injection of custom "scoring" class
  through `OfferRanker` interface

And some minor things as well:

* Moved `TaskAssignerImpl`, `TaskSchedulerImpl`, and `HostOffers` into their own
  upper-level classes
* Moved `TaskAssigner` to the `scheduling` package and out of the `state` package
* Renamed some methods in `OfferManager` to avoid code stutter
* Renaming of some classes (e.g. `FirstFitTaskAssigner` -> `TaskAssignerImpl`)
* And a slew of others

Reviewed at https://reviews.apache.org/r/63973/

6 months agoRemove task level resource fields from thrift interface
Nicolás Donatucci [Tue, 28 Nov 2017 01:01:03 +0000 (17:01 -0800)] 
Remove task level resource fields from thrift interface

Bugs closed: AURORA-1707

Reviewed at https://reviews.apache.org/r/60942/

7 months agoReplace node-sass with sass.js
David McLaughlin [Wed, 22 Nov 2017 01:22:25 +0000 (17:22 -0800)] 
Replace node-sass with sass.js

Reviewed at https://reviews.apache.org/r/64015/

7 months agoGive jobs the ability to determine how to handle partitions by integrating with new...
David McLaughlin [Tue, 21 Nov 2017 22:17:39 +0000 (14:17 -0800)] 
Give jobs the ability to determine how to handle partitions by integrating with new Mesos Partition-Aware APIs.

  * Adds a new flag -partition_aware that will subscribe to the new Mesos partition-aware states.
  * Adds a new configuration object, PartitionPolicy, to give job owners control over how to handle tasks that become partitioned.

Reviewed at https://reviews.apache.org/r/63536/

7 months agoFix flaky MesosCallbackHandlerTest
Jordan Ly [Wed, 15 Nov 2017 01:43:58 +0000 (17:43 -0800)] 
Fix flaky MesosCallbackHandlerTest

In the same vein as: https://reviews.apache.org/r/63760/

Fix a flaky test that uses `Thread.sleep` by injecting a fake Executor.

Reviewed at https://reviews.apache.org/r/63763/

7 months agoUse transition method and fix documentation in Webhooks
Jordan Ly [Wed, 15 Nov 2017 01:42:50 +0000 (17:42 -0800)] 
Use transition method and fix documentation in Webhooks

Reviewed at https://reviews.apache.org/r/63705/

7 months agoRemove LockStore
Bill Farner [Tue, 14 Nov 2017 00:35:36 +0000 (16:35 -0800)] 
Remove LockStore

Reviewed at https://reviews.apache.org/r/63744/

7 months agoMake testTaskChangedWithOldStateError more robust
Bill Farner [Mon, 13 Nov 2017 22:46:45 +0000 (14:46 -0800)] 
Make testTaskChangedWithOldStateError more robust

Reviewed at https://reviews.apache.org/r/63760/

7 months agoAdd a workaround for test_du_diskcollector failing on macOS
Bill Farner [Mon, 13 Nov 2017 21:44:39 +0000 (13:44 -0800)] 
Add a workaround for test_du_diskcollector failing on macOS

Bugs closed: AURORA-1956

Reviewed at https://reviews.apache.org/r/63746/

7 months agoRemove the internal SQL database
Bill Farner [Mon, 13 Nov 2017 21:19:28 +0000 (13:19 -0800)] 
Remove the internal SQL database

Reviewed at https://reviews.apache.org/r/63743/

7 months agoUpdate to Mesos 1.4
Stephan Erb [Mon, 13 Nov 2017 08:37:01 +0000 (09:37 +0100)] 
Update to Mesos 1.4

This is a non-breaking update to the latest Mesos version.

The mesos.interface Python package has a requirement on a
newer protobuf version. I applied the same update to Java
for consistency.

* Mesos update instructions: https://mesos.apache.org/documentation/latest/upgrades/
  (i.e no feature removed that we currently rely on)
* Mesos 1.3 changelog: https://mesos.apache.org/blog/mesos-1-3-0-released/
* Mesos 1.4 changelog: https://mesos.apache.org/blog/mesos-1-4-0-released/
* Protobuf update of Mesos: https://reviews.apache.org/r/58358
  (Zhitao Li says he tested compatibility with Aurora using the old protobufs)
* Protobuf changelog: https://github.com/google/protobuf/blob/3.3.x/CHANGES.txt

Testing Done:
I tested the following end to end test scenarios and they worked:

* this patch (Mesos 1.4) in the old vagrant box (against Mesos 1.2)
* this patch (Mesos 1.4) in the new vagrant box (against Mesos 1.4)
* master (Mesos 1.2) in the new vagrant box (against Mesos 1.4)

Reviewed at https://reviews.apache.org/r/63531/

7 months agoAdd a test for storage durability
Bill Farner [Thu, 9 Nov 2017 17:26:50 +0000 (09:26 -0800)] 
Add a test for storage durability

Reviewed at https://reviews.apache.org/r/63670/

7 months agoFix tutorial test script
David McLaughlin [Thu, 9 Nov 2017 00:43:18 +0000 (16:43 -0800)] 
Fix tutorial test script

Update script to reflect the contents of tutorial.md

Reviewed at https://reviews.apache.org/r/63688/

7 months agoIncrementing snapshot version to 0.20.0-SNAPSHOT.
Bill Farner [Wed, 8 Nov 2017 04:47:30 +0000 (20:47 -0800)] 
Incrementing snapshot version to 0.20.0-SNAPSHOT.

7 months agoUpdating CHANGELOG for 0.19.0 release.
Bill Farner [Wed, 8 Nov 2017 04:47:30 +0000 (20:47 -0800)] 
Updating CHANGELOG for 0.19.0 release.

7 months agoUpdate release notes in preparation for 0.19.0 release
Bill Farner [Wed, 8 Nov 2017 04:47:04 +0000 (20:47 -0800)] 
Update release notes in preparation for 0.19.0 release

7 months agoUse a pair of fields for caching offer resources rather than a Cache
Bill Farner [Wed, 8 Nov 2017 02:45:05 +0000 (18:45 -0800)] 
Use a pair of fields for caching offer resources rather than a Cache

Reviewed at https://reviews.apache.org/r/63454/

7 months agoDisplay pending task reasons in TaskList
David McLaughlin [Wed, 8 Nov 2017 00:22:08 +0000 (16:22 -0800)] 
Display pending task reasons in TaskList

Reviewed at https://reviews.apache.org/r/63650/

7 months agoDon't show host data when task is Throttled.
David McLaughlin [Wed, 8 Nov 2017 00:13:02 +0000 (16:13 -0800)] 
Don't show host data when task is Throttled.

PENDING and THROTTLED tasks are considered active and they dont have hosts. This manifests in having "null" host links.

Reviewed at https://reviews.apache.org/r/63648/

7 months agoPolling updates page if in progress in UI
Reza Motamedi [Wed, 8 Nov 2017 00:08:13 +0000 (16:08 -0800)] 
Polling updates page if in progress in UI

Reviewed at https://reviews.apache.org/r/63337/

7 months agoMigrate from findbugs to spotbugs
Stephan Erb [Tue, 7 Nov 2017 07:26:58 +0000 (08:26 +0100)] 
Migrate from findbugs to spotbugs

Findbugs [1] is no longer developed and replaced by spotbugs [2]
as mostly a drop-in replacement.

[1] https://github.com/findbugsproject/findbugs
[2] https://mailman.cs.umd.edu/pipermail/findbugs-discuss/2017-September/004383.html

Reviewed at https://reviews.apache.org/r/63564/

7 months agoFixed issue where saving attributes are not being persisted to log
Jordan Ly [Thu, 2 Nov 2017 21:49:10 +0000 (14:49 -0700)] 
Fixed issue where saving attributes are not being persisted to log

A bug was introduced when the old `MemAttributeStore` was revived. Previously,
the `saveHostAttributes` method did not return anything. However, after
migrating to the DB stores, the signature of the interface was changed to return
a `boolean` if the save modified the previous attributes. The new changes
accidentally inverted the order. The `AbstractAttributeStoreTest` did not test
for this scenario so it went unnoticed.

Reviewed at https://reviews.apache.org/r/63521/

7 months agoTerminate the executor on unhandled errors
Stephan Erb [Thu, 2 Nov 2017 11:01:40 +0000 (12:01 +0100)] 
Terminate the executor on unhandled errors

This commit consits of two independent parts:

a) ensure we interrupt the main thread when there are unhandled exceptions
b) ensure the main thread of the executor can be interrupted

Testing Done:
This bug is pretty hard to reproduce and test. I therefore opted for a manual
verification and injected an exception throw shortly before the last statement
of the `AuroraExecutor._shutdown` method. Without this patch, this resulted in
hanging executors on the host. With this patch everything is terminated as
expected.

For details of the suffessful run, please see the executor logs below. Please
note that the `apport.fileutils` is due to Ubuntu messing  with its Python
installation. This is not critical.

```
twitter.common.app debug: Initializing: apache.thermos.common.excepthook (Exception termination handler.)
I1031 15:59:37.188621 25437 exec.cpp:162] Version: 1.2.0
I1031 15:59:37.192201 25429 exec.cpp:237] Executor registered on agent 93259518-14f4-4956-a39c-aa615bff9a5e-S0
Writing log files to disk in /var/lib/mesos/slaves/93259518-14f4-4956-a39c-aa615bff9a5e-S0/frameworks/7b202c2e-8796-4f27-afeb-8b76ba4b3037-0000/executors/thermos-www-data-prod-hello-0-d8d50c2f-e79b-467d-8c65-cca3cb44cf9c/runs/54a5ed51-aa9b-476f-9f75-0b42bd6dfa8d

ERROR] Unhandled error in <StatusManager(Thread-7 [TID=25450], started daemon 139968452134656)>. Interrupting main thread.
Traceback (most recent call last):
  File "/root/.pex/install/twitter.common.exceptions-0.3.7-py2-none-any.whl.f6376bcca9bfda5eba4396de2676af5dfe36237d/twitter.common.exceptions-0.3.7-py2-none-any.whl/twitter/common/exceptions/__init__.py", line 126, in _excepting_run
    self.__real_run(*args, **kw)
  File "apache/aurora/executor/status_manager.py", line 62, in run
  File "apache/aurora/executor/aurora_executor.py", line 236, in _shutdown
RuntimeError: Woops!
Exception in thread Thread-7 [TID=25450]:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/root/.pex/install/twitter.common.decorators-0.3.7-py2-none-any.whl.b23f2874a4392741fca582d9e0528c08e0335c68/twitter.common.decorators-0.3.7-py2-none-any.whl/twitter/common/decorators/threads.py", line 115, in identified
    return instancemethod(self, *args, **kwargs)
  File "/root/.pex/install/twitter.common.exceptions-0.3.7-py2-none-any.whl.f6376bcca9bfda5eba4396de2676af5dfe36237d/twitter.common.exceptions-0.3.7-py2-none-any.whl/twitter/common/exceptions/__init__.py", line 130, in _excepting_run
    sys.excepthook(*sys.exc_info())
  File "apache/thermos/common/excepthook.py", line 41, in teardown_handler
    self._former_hook()(exc_type, value, trace)
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
ImportError: No module named apport.fileutils

twitter.common.app debug: main exited with ^C
twitter.common.app debug: Shutting application down.
twitter.common.app debug: Running exit function for apache.thermos.common.excepthook (Exception termination handler.)
twitter.common.app debug: Running exit function for twitter.common.log (Logging subsystem.)
twitter.common.app debug: Finishing up module teardown.
twitter.common.app debug:   Active thread: <_MainThread(MainThread, started 139968622749504)>
twitter.common.app debug:   Active thread (daemon): <TaskResourceMonitor(TaskResourceMonitor[www-data-prod-hello-0-d8d50c2f-e79b-467d-8c65-cca3cb44cf9c] [TID=25449], started daemon 139967951009536)>
twitter.common.app debug:   Active thread (daemon): <_DummyThread(Dummy-13, started daemon 139968485705472)>
twitter.common.app debug:   Active thread (daemon): <WaitThread(Thread-9, started daemon 139967934224128)>
twitter.common.app debug:   Active thread (daemon): <WaitThread(Thread-12, started daemon 139967942616832)>
twitter.common.app debug:   Active thread (daemon): <_DummyThread(Dummy-3, started daemon 139968510883584)>
twitter.common.app debug:   Active thread (daemon): <WaitThread(Thread-11, started daemon 139967925831424)>
twitter.common.app debug: Exiting cleanly.
```

Corresponding agent logs, indicating that Mesos knows about the crash on teardown:
```
I1031 15:59:54.692739  1956 slave.cpp:4769] Executor 'thermos-www-data-prod-hello-0-d8d50c2f-e79b-467d-8c65-cca3cb44cf9c' of framework 7b202c2e-8796-4f27-afeb-8b76ba4b3037-0000 exited with status 130
I1031 15:59:54.692834  1956 slave.cpp:4869] Cleaning up executor 'thermos-www-data-prod-hello-0-d8d50c2f-e79b-467d-8c65-cca3cb44cf9c' of framework 7b202c2e-8796-4f27-afeb-8b76ba4b3037-0000 at executor(1)@192.168.33.7:48931
I1031 15:59:54.692996  1956 slave.cpp:4957] Cleaning up framework 7b202c2e-8796-4f27-afeb-8b76ba4b3037-0000
```

Bugs closed: AURORA-1955

Reviewed at https://reviews.apache.org/r/63443/

7 months agoRefactor staticallyBannedOffers into a LRU cache
Jordan Ly [Tue, 31 Oct 2017 17:20:27 +0000 (10:20 -0700)] 
Refactor staticallyBannedOffers into a LRU cache

Using the new `hold_offers_forever` option, it is possible for the
`staticallyBannedOffers` to grow very large in size as we never release
offers.
1. The current behavior of `staticallyBannedOffers` is (kinda) preserved.
   Entries will no longer be removed when the offer is used, but they will be
   removed within `maxOfferHoldTime`. This means cluster operators will not
   have to think about the new `offer_static_ban_cache_max_size` if they aren't
   affected by the memory leak now.
2. Cluster operators that use Aurora as a single framework and hold offers
   indefinitely can cap the size of the cache to avoid the memory leak.
3. Using an LRU cache greatly benefits quickly recurring crons and job updates.

Reviewed at https://reviews.apache.org/r/63199/

7 months agoRemove inaccurate "Initializing sandbox" message
Stephan Erb [Tue, 31 Oct 2017 16:24:04 +0000 (17:24 +0100)] 
Remove inaccurate "Initializing sandbox" message

The message is no longer completely accurate, now that we remain in
`STARTING` until health checks have passed.

Reviewed at https://reviews.apache.org/r/63435/

7 months agoRemove endpoint.thrift, ServiceInstance is never serialized to thrift
Bill Farner [Tue, 31 Oct 2017 04:58:13 +0000 (21:58 -0700)] 
Remove endpoint.thrift, ServiceInstance is never serialized to thrift

This enables removal of some unnecessary complexity in the build (commons no
longer needs thrift) and the unused Codec abstraction (we always encode in
JSON).

Reviewed at https://reviews.apache.org/r/63418/

7 months agoCondense whitespace of navigation and breadcrumb, reduce impact of quota widget
David McLaughlin [Mon, 30 Oct 2017 23:26:13 +0000 (16:26 -0700)] 
Condense whitespace of navigation and breadcrumb, reduce impact of quota widget

Reviewed at https://reviews.apache.org/r/63406/

7 months agoAdd resource units to config summary
David McLaughlin [Mon, 30 Oct 2017 15:37:19 +0000 (08:37 -0700)] 
Add resource units to config summary

Reviewed at https://reviews.apache.org/r/63375/

7 months agoAdd support for generating patch RCs from non-master branches
Bill Farner [Mon, 30 Oct 2017 15:03:44 +0000 (08:03 -0700)] 
Add support for generating patch RCs from non-master branches

Reviewed at https://reviews.apache.org/r/63401/

7 months agoAdd release notes for 0.18.1
Bill Farner [Sun, 29 Oct 2017 17:27:06 +0000 (10:27 -0700)] 
Add release notes for 0.18.1