Skip to content

Commit

Permalink
Merge pull request #168 from palantir/native.health.checks
Browse files Browse the repository at this point in the history
Deprecate Aggressive shutdown strategies
  • Loading branch information
alicederyn authored Mar 1, 2017
2 parents caba355 + 6ddadad commit 040af72
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,41 @@
*/
public interface ShutdownStrategy {

/**
* Call rm on all containers, working around btrfs bug on CircleCI.
*
* @deprecated Use {@link #KILL_DOWN} (the default strategy)
*/
@Deprecated
ShutdownStrategy AGGRESSIVE = new AggressiveShutdownStrategy();
ShutdownStrategy GRACEFUL = new GracefulShutdownStrategy();
ShutdownStrategy SKIP = new SkipShutdownStrategy();
/**
* Call rm on all containers, then call docker-compose down.
*
* @deprecated Use {@link #KILL_DOWN} (the default strategy)
*/
@Deprecated
ShutdownStrategy AGGRESSIVE_WITH_NETWORK_CLEANUP = new AggressiveShutdownWithNetworkCleanupStrategy();
/**
* Call docker-compose down, kill, then rm. Allows containers up to 10 seconds to shut down
* gracefully.
*
* <p>With this strategy, you will need to take care not to accidentally write images
* that ignore their down signal, for instance by putting their run command in as a
* string (which is interpreted by a SIGTERM-ignoring bash) rather than an array of strings.
*/
ShutdownStrategy GRACEFUL = new GracefulShutdownStrategy();
/**
* Call docker-compose kill then down.
*/
ShutdownStrategy KILL_DOWN = new KillDownShutdownStrategy();
/**
* Skip shutdown, leaving containers running after tests finish executing.
*
* <p>You can use this option to speed up repeated test execution locally by leaving
* images up between runs. Do <b>not</b> commit it! You will be potentially abandoning
* long-running processes and leaking resources on your CI platform!
*/
ShutdownStrategy SKIP = new SkipShutdownStrategy();

void shutdown(DockerCompose dockerCompose, Docker docker) throws IOException, InterruptedException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
/**
* Shuts down containers as fast as possible, without giving them time to finish
* IO or clean up any resources.
*
* @deprecated Use {@link ShutdownStrategy#KILL_DOWN}
*/
@Deprecated
public class AggressiveShutdownStrategy implements ShutdownStrategy {

private static final Logger log = LoggerFactory.getLogger(AggressiveShutdownStrategy.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

/**
* Shuts down containers as fast as possible while cleaning up any networks that were created.
*
* @deprecated Use {@link ShutdownStrategy#KILL_DOWN}
*/
@Deprecated
public class AggressiveShutdownWithNetworkCleanupStrategy implements ShutdownStrategy {

private static final Logger log = LoggerFactory.getLogger(AggressiveShutdownWithNetworkCleanupStrategy.class);
Expand Down

0 comments on commit 040af72

Please sign in to comment.