You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/01 16:18:00 UTC

[jira] [Work logged] (KNOX-1819) Ensure services are started and stopped in the correct order.

     [ https://issues.apache.org/jira/browse/KNOX-1819?focusedWorklogId=221343&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221343 ]

ASF GitHub Bot logged work on KNOX-1819:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Apr/19 16:17
            Start Date: 01/Apr/19 16:17
    Worklog Time Spent: 10m 
      Work Description: rlevas commented on pull request #82: KNOX-1819 - Ensure services are started and stopped in the correct order
URL: https://github.com/apache/knox/pull/82
 
 
   ## What changes were proposed in this pull request?
   
   Ensure services are started and stopped in the correct order in `org.apache.knox.gateway.services.DefaultGatewayServices` and `org.apache.knox.gateway.services.CLIGatewayServices`.
   
   The following order is being enforced for starting services:
   
   1. MasterService
   1. KeystoreService
   1. AliasService
   1. SslService
   1. TokenService
   1. ServerInfoService
   1. RemoteRegistryClientService
   1. ClusterConfigurationMonitorervice
   1. TopologyService
   1. MetricsService
   1. CryptoService
   1. HostMappingService
   1. ServiceDefinitionRegistry
   1. ServiceRegistryService
   
   The order is reversed for stopping. 
   
   A new class, `org.apache.knox.gateway.services.ServiceType`, was added to enumerate the different service types.
   
   A new class, `org.apache.knox.gateway.services.AbstractGatewayServices`, was added to implement the starting and stopping order listed above. Only _registered_ services will be started and stopped. An associated unit test class was added as well -  `org.apache.knox.gateway.services.AbstractGatewayServicesTest`
   
   The rest of the changes are basically converting `GatewayServices` constants to `ServiceType` enums... for example, `GatewayServices.MASTER_SERVICE` to `ServiceType.MASTER_SERVICE`
   
   ## How was this patch tested?
   
   Added new unit tests and executed them:
   ```
   mvn -T.5C verify -Prelease,package
   ...
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time: 16:22 min (Wall Clock)
   [INFO] Finished at: 2019-04-01T11:19:15-04:00
   [INFO] Final Memory: 274M/1472M
   [INFO] ------------------------------------------------------------------------
   ```
   
   Started server to see new logged messages:
   ```
   2019-04-01 12:14:52,720 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: MasterService
   2019-04-01 12:14:52,720 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: KeystoreService
   2019-04-01 12:14:52,720 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: AliasService
   2019-04-01 12:14:52,720 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: SSLService
   2019-04-01 12:14:52,720 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: TokenService
   2019-04-01 12:14:52,722 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: ServerInfoService
   2019-04-01 12:14:52,722 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: RemoteConfigRegistryClientService
   2019-04-01 12:14:52,722 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: ClusterConfigurationMonitorService
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: TopologyService
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: MetricsService
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: CryptoService
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: HostMappingService
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: ServiceDefinitionRegistry
   2019-04-01 12:14:52,723 INFO  knox.gateway (AbstractGatewayServices.java:start(67)) - Starting service: ServiceRegistryService
   ```
   
   Please review [Knox Contributing Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow) before opening a pull request.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 221343)
            Time Spent: 10m
    Remaining Estimate: 0h

> Ensure services are started and stopped in the correct order.
> -------------------------------------------------------------
>
>                 Key: KNOX-1819
>                 URL: https://issues.apache.org/jira/browse/KNOX-1819
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>            Reporter: Robert Levas
>            Assignee: Robert Levas
>            Priority: Minor
>             Fix For: 1.3.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Ensure services are started and stopped in the correct order in {{org.apache.knox.gateway.services.DefaultGatewayServices}} and {{org.apache.knox.gateway.services.CLIGatewayServices}}. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)