Runtime View
This chapter describes common runtime behaviour of the GDI Node components in specific cases.
Launch
Each component will perform following (on failure, the component will stop with an error exit code):
- Gather configuration from configuration file(s), environment-variables, and Vault.
- Configure the logging system.
- Establish activity monitor (auditing) for tracking background tasks.
- Initiate Postgres connection(s) for connection-pooling. (Ping the database.)
- Check other critical connections of the component (e.g. Minio, directory access permissions)
- Launch the HTTP-listener.
Shutdown
- Wait for known background tasks of the local instance to finish.
- Shut down the HTTP listener.
- Close all client-connections (e.g. Postgres).
- Exit with status code 0.
Request Verification
- Get sesssion info from the cookie.
- If missing but session is required, respond with a temporary redirect to the authentication service.
- Request session info from
node-session.- If the session has expired, respond with a temporary redirect to the authentication service.
- Establish user context and user activity monitor.
- This context also contains user’s permissions.
- Continue processing the request.
- Finalise the user request processing info in activity monitor.
- Return HTTP response.
Exception Reporting
- Exceptions must be caught and logged at minimum.
- Exception with origin and stack-trace should be included in an activity context for audit-logging.
- In HTTP responses, the server must respond with HTTP 500 Problem-Details response.
- Exceptions/errors are reported in English. The stack-traces must not be revealed to users (except in audit-logs).
- If user can do something about the error, the message should include that action in its description. Otherwise, the default action is to contact the customer-support (helpdesk).
- In UI, the error needs to be presented to the user (even failed requests when service is unavailable).
- Administrative user with special permission needs a clear UI for viewing past exceptions (optionally marking them resolved or unresolved).
- Details about an exception:
- timestamp: when error occurred
- request: method, path, and parameters,
- session: ID, username, permissions
- client: IP-address, browser (User-Agent)
- component: name, host/pod
- error:
- type: client, internal, external
- message: the main error message
- details: optionally additional details
- hint: optional suggestion for the user