-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appserver improvements. #357
Conversation
* Combined the appserver.Server and appserver.ProcManager concepts. * Have one rpc.Server per proc. * Various refactoring and renamings.
* Simplified app.Client initialization. * Simplified app logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments, overall - great job! btw, I think we're mixing app
and proc
terms here. probably we should consider moving on to just a single one of it as it may get confusing at some point
func (c *ProcConfig) encodeJSON() []byte { | ||
b, err := json.Marshal(c) | ||
if err != nil { | ||
panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about getting rid of panic and just returning an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like panic
is suited here because json.Marshal
will only return error if the ProcConfig
definition is problematic (which should never happen).
As mentioned on Discord:
|
https://discordapp.com/channels/466450852098605059/552769767904116737/709679913309044759 @Darkren wrote:
|
* Separated app-associated functionality within /pkg/visor into /pkg/app/launcher. * Added the concept of visor.BaseConfig() to simplify obtaining default values. * Made startup/shutdown logic modular and introduced init and shutdown stacks. * Shutdown now uses module-based timeouts and wait groups.
Improve visor config and startup/shutdown logic.
Appserver improvements: * Combined the appserver.Server and appserver.ProcManager concepts. * Have one rpc.Server per app proc. * Simplified app.Client initialization. * Visor to App initialization is done via a single env defined for the app PROC_CONFIG which contains a JSON object. * App to Visor initialization is done by App connecting the Visor via app server address. The first 16 bytes that the App sends to Visor is the appcommon.ProcKey. * Changed appcommon.ProcKey format so that it is a deterministic length. * Improved app logging and removed any possibilities of log database race conditions with bbolt. * Various logging improvements. App management, visor config, startup and shutdown improvements: * Separated app-associated functionality within /pkg/visor into /pkg/app/launcher. * Added the concept of visor.BaseConfig() to simplify obtaining default values. * Made startup/shutdown logic modular and introduced init and shutdown stacks. * Shutdown now uses module-based timeouts and wait groups. Changes as suggested by @Darkren and @nkryuchkov Former-commit-id: 6c4c0d5
Fixes #338
Changes:
appserver.Server
andappserver.ProcManager
concepts.rpc.Server
per app proc.app.Client
initialization.PROC_CONFIG
which contains a JSON object.appcommon.ProcKey
.appcommon.ProcKey
format so that it is a deterministic length.bbolt
.