[ 
https://issues.apache.org/jira/browse/LENS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Srikanth Sundarrajan updated LENS-163:
--------------------------------------
    Attachment: LENS-163-v1.patch

Based on the feedback, here are things done in this revised patch.

1. Shutdown hook replaces the Signal & Signal Handlers
2. Time based wait bound by a conditional check (which is reset by the shutdown 
hook - backed by a volatile)
3. Build info stored into a resource file, which is printed when the server 
starts & stops

I have tested the following scenarios:

1. Start & Stop sequence before the shutdown hook gets registered
2. Complete start, followed by a stop sequence

Above steps were tested using lens-ctl

{noformat}
C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ bin/lens-ctl  start
/projects/incubator-lens/lens-dist/target/lens-dist-2.0.0-SNAPSHOT-server
Adding hadoop libs in classpath from /opt/hadoop-2.2.0
HIVE_HOME is set, adding 
/projects/hive-hive-release-0.13.0/packaging/target/apache-hive-0.13.0-bin/apache-hive-0.13.0-bin//lib/*
 into lens classpath
Started lens server!


C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ head logs/lensserver.log 
26 Dec 2014 18:07:55,709 [main] INFO  org.apache.lens.server.LensServer  - 
###############################################################
                    Lens Server (STARTUP)
        vc.source.url:  
scm:git:https://git-wip-us.apache.org/repos/asf/incubator-lens.git/lens-server
        project.version:        2.0.0-SNAPSHOT
        build.epoch:    1419597411417
        build.user:     sriksun
        vc.revision:    fb038e0bf964ec9f4b3ad973bf6e5c275df80224
        build.version:  2.0.0-SNAPSHOT-rfb038e0bf964ec9f4b3ad973bf6e5c275df80224
###############################################################
...


C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ tail logs/lensserver.log 
26 Dec 2014 18:08:03,111 [main] INFO  
org.apache.lens.server.LensApplicationListener  - Application AllApps was 
initialized.
...
26 Dec 2014 18:08:03,417 [main] INFO  
org.glassfish.grizzly.http.server.HttpServer  - [HttpServer-1] Started.


C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ bin/lens-ctl  stop
Stopping lens server running as 4559
.Stopped lens server!


C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ tail  logs/lensserver.log 
26 Dec 2014 18:08:13,595 [Shutdown] INFO  
org.apache.hadoop.hive.metastore.HiveMetaStore.audit  - ugi=sriksun   
ip=unknown-ip-addr      cmd=Metastore shutdown complete.        
...
26 Dec 2014 18:08:13,595 [Shutdown] INFO  
org.apache.hive.service.AbstractService  - Service:lens_services is stopped.
26 Dec 2014 18:08:13,595 [Shutdown] INFO  org.apache.lens.server.LensServer  - 
###############################################################
                    Lens Server (SHUTDOWN)
###############################################################


C02MQ0YCFD56:lens-dist-2.0.0-SNAPSHOT-server sriksun$ ps -p 4559
  PID TTY           TIME CMD

{noformat}

> Fix Lens Server & Stop related issues. Was (Proprietary classes referenced in 
> LensServer)
> -----------------------------------------------------------------------------------------
>
>                 Key: LENS-163
>                 URL: https://issues.apache.org/jira/browse/LENS-163
>             Project: Apache Lens
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 2.0
>            Reporter: Srikanth Sundarrajan
>            Assignee: Srikanth Sundarrajan
>             Fix For: 2.0
>
>         Attachments: LENS-163-v1.patch, LENS-163.patch
>
>
> LensServer imports the following dependencies
> {code}
> import sun.misc.Signal;
> import sun.misc.SignalHandler;
> {code}
> and this is being used to register essentially shutdownhook.
> {code}
> ...
>     Signal.handle(new Signal("TERM"), new SignalHandler() {
>       @Override
>       public void handle(Signal signal) {
> ...
> {code}
> We should use Runtime::addShutdownHook() instead.
> Besides issues reported relating to proprietary class references, there are 
> other issues in how start & stop are handled. Broadening the scope of this 
> issue based on feedback from [~jaideepdhok] and laxman



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to