Comments (6)
From @justenwalker in #22 (comment):
In my mind, OnStop makes more sense to happen after the application exits rather than before - so that we know the service isn't interacting with anything before we send cleanup commands (like Finally block)
That raises questions about the inconsistency with of the language compared to onStart
. onStart
is actually executed before the application starts. The following is a crappy solution, in my mind, but it avoids changing any existing code:
onStart
before application startonStarted
after application startonStop
before application stoponStopped
after application stop
The following is more clear, in my mind, but does require changing existing code:
preStart
before application start, the current behavior ofonStart
postStart
after application startpreStop
before application stoppostStop
after application stop
...though I hasten to add that I don't really see a need for postStart
, I'm just enumerating it for clarity.
from containerpilot.
@justenwalker the title of the ticket may be too specific given our similar, but slightly different interests. Would you be okay with retitling it in a way that fits the conversation about pre and post stopped execution?
from containerpilot.
onStarted
after application start
This is going to be difficult to actually implement because we block execution flow on the application. Even if we could figure out a way around that, the application can "start" (as in fork) but not actually be "running" for any useful purpose. e.g. slow Java startup times.
onStop
before application stop
Services deregister and then stop. Does this happen before or after the service is deregistered?
from containerpilot.
So do we need something like:
onStart
- UnchangedpreStop
- Runs before Containerbuddy terminates the application - blockspostStop
- Runs after the application terminates
It's not symmetric - but I'm not convinced it needs to be. Does it even make sense to run an application after the App starts? We are already polling the application, which is semantically similar to postStart
from containerpilot.
It's not symmetric
That's probably fine.
but I'm not convinced it needs to be. Does it even make sense to run an application after the App starts? We are already polling the application, which is semantically similar to
postStart
I'm in agreement there.
from containerpilot.
Released with https://github.com/joyent/containerbuddy/releases/tag/0.0.4
from containerpilot.
Related Issues (20)
- Stability issues with signal events under SmartOS/LX HOT 2
- [Question]How to disable default metrics and only response custom defined metrics? HOT 5
- Building inside a docker container HOT 2
- SmartOS and LX brand issues with Go 1.9
- Docs incorrectly say 'initialStatus', should be 'initial_status' HOT 2
- Telemetry custom metrics always zero HOT 4
- Run as user per job HOT 5
- Allow for an ADHoc Sending of a signal to a ContainerPilot job. HOT 1
- Project status HOT 3
- Error parsing environment variable in config template
- Unable to execute job HOT 1
- CP ends up ignoring that it's jobs have been killed
- Local build on SmartOS fails due to upstream changes
- 100% CPU Usage
- github url's in documentation
- Documentation Update: docker-compose --scale "change"
- consul with TLS does not read env vars set by -putenv
- Broken link to blog/wordpress-on-autopilot
- Container Pilot process get hung and cannot recover when health check timeouts continues for more than an hour
- Support consul service meta data HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from containerpilot.