Skip to content

move jetty module to Lifecycle.Stage.LAST#7215

Merged
gianm merged 1 commit intoapache:masterfrom
clintropolis:jetty-lifecycle-stuff
Mar 9, 2019
Merged

move jetty module to Lifecycle.Stage.LAST#7215
gianm merged 1 commit intoapache:masterfrom
clintropolis:jetty-lifecycle-stuff

Conversation

@clintropolis
Copy link
Copy Markdown
Member

#5429 added graceful shutdown for jetty to allow queries the chance to complete successfully, which is rad. However, some things, such as lookup module, just can't be bothered to care, and the module stops before the jetty module and closes lookups. The end result is that even though jetty will allow in flight queries time to complete, they will not be able to do so because lookups or another failure as a result of already stopped modules.

This PR moves the jetty module to Lifecycle.Stage.LAST, which effectively makes jetty the 2nd to last thing to start before the server announces itself for discovery, and the 2nd module to stop, immediately after the discovery module stops (or after the delay if druid.server.http.unannouncePropogationDelay is set).

This PR also moves 'http-client' onto the lifecycle of the LifecycleModule instead of creating it's own Lifecycle that was attached to the modules lifecycle. I believe this was an artifact of when it was in java-util and using the Lifecycle from that library, and is not necessary.

I haven't thought of a great way to write tests for this, but I have tested in a small cluster on my dev machine, and can provide a log to show the effect the change has.

Note that before the change, many things are stopped before jetty such as LookupReferencesManager, DruidLeaderClient, CuratorDruidNodeDiscoveryProvider, and NettyHttpClient among other things.

before:

2019-03-08T10:18:50,508 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Lifecycle [module] running shutdown hook
2019-03-08T10:18:50,509 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [LAST]
2019-03-08T10:18:50,511 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeAnnouncer - Unannouncing [DiscoveryDruidNode{druidNode=DruidNode{serviceName='druid/historical', host='localhost', bindOnHost=false, port=-1, plaintextPort=8083, enablePlaintextPort=true, tlsPort=-1, enableTlsPort=false}, nodeType='HISTORICAL', services={dataNodeService=DataNodeService{tier='_default_tier', maxSize=10000000000, type=historical, priority=0}, lookupNodeService=LookupNodeService{lookupTier='__default'}}}].
2019-03-08T10:18:50,511 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/internal-discovery/HISTORICAL/localhost:8083]
2019-03-08T10:18:50,537 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeAnnouncer - Unannounced [DiscoveryDruidNode{druidNode=DruidNode{serviceName='druid/historical', host='localhost', bindOnHost=false, port=-1, plaintextPort=8083, enablePlaintextPort=true, tlsPort=-1, enableTlsPort=false}, nodeType='HISTORICAL', services={dataNodeService=DataNodeService{tier='_default_tier', maxSize=10000000000, type=historical, priority=0}, lookupNodeService=LookupNodeService{lookupTier='__default'}}}].
2019-03-08T10:18:50,537 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [NORMAL]
2019-03-08T10:18:50,537 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.listener.announcer.ListenerResourceAnnouncer.stop()] on object[org.apache.druid.query.lookup.LookupResourceListenerAnnouncer@73bb1337].
2019-03-08T10:18:50,538 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/listeners/lookups/__default/http:localhost:8083]
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.server.listener.announcer.ListenerResourceAnnouncer - Unannouncing start time on [/druid/listeners/lookups/__default/http:localhost:8083]
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.query.lookup.LookupReferencesManager.stop()] on object[org.apache.druid.query.lookup.LookupReferencesManager@632b305d].
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.query.lookup.LookupReferencesManager - LookupReferencesManager is stopping.
2019-03-08T10:18:50,542 INFO [LookupReferencesManager-MainThread] org.apache.druid.query.lookup.LookupReferencesManager - Lookup Management loop exited, Lookup notices are not handled anymore.
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.query.lookup.LookupReferencesManager - LookupReferencesManager is stopped.
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.discovery.DruidLeaderClient.stop()] on object[org.apache.druid.discovery.DruidLeaderClient@58278366].
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.discovery.DruidLeaderClient - Stopped.
2019-03-08T10:18:50,542 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.discovery.ServerDiscoverySelector.stop() throws java.io.IOException] on object[org.apache.druid.curator.discovery.ServerDiscoverySelector@59636c47].
2019-03-08T10:18:50,544 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider.stop()] on object[org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider@6467ddc7].
2019-03-08T10:18:50,544 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider - stopping
2019-03-08T10:18:50,544 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider - stopped
2019-03-08T10:18:50,545 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [http-client] stage [LAST]
2019-03-08T10:18:50,545 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [http-client] stage [NORMAL]
2019-03-08T10:18:50,545 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.http.client.NettyHttpClient.stop()] on object[org.apache.druid.java.util.http.client.NettyHttpClient@2f054f70].
2019-03-08T10:18:50,564 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [http-client] stage [INIT]
2019-03-08T10:18:50,564 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.coordination.ZkCoordinator.stop()] on object[org.apache.druid.server.coordination.ZkCoordinator@35eee641].
2019-03-08T10:18:50,564 INFO [Thread-60] org.apache.druid.server.coordination.ZkCoordinator - Stopping ZkCoordinator for [DruidServerMetadata{name='localhost:8083', hostAndPort='localhost:8083', hostAndTlsPort='null', maxSize=10000000000, tier='_default_tier', type=historical, priority=0}]
2019-03-08T10:18:50,565 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.coordination.SegmentLoadDropHandler.stop()] on object[org.apache.druid.server.coordination.SegmentLoadDropHandler@4b56b031].
2019-03-08T10:18:50,565 INFO [Thread-60] org.apache.druid.server.coordination.SegmentLoadDropHandler - Stopping...
2019-03-08T10:18:50,565 INFO [Thread-60] org.apache.druid.server.coordination.CuratorDataSegmentServerAnnouncer - Unannouncing self[DruidServerMetadata{name='localhost:8083', hostAndPort='localhost:8083', hostAndTlsPort='null', maxSize=10000000000, tier='_default_tier', type=historical, priority=0}] at [/druid/announcements/localhost:8083]
2019-03-08T10:18:50,565 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/announcements/localhost:8083]
2019-03-08T10:18:50,571 INFO [Thread-60] org.apache.druid.server.coordination.SegmentLoadDropHandler - Stopped.
2019-03-08T10:18:50,571 INFO [Thread-60] org.apache.druid.server.initialization.jetty.JettyServerModule - Stopping Jetty Server...
2019-03-08T10:18:50,580 INFO [Thread-60] org.eclipse.jetty.server.AbstractConnector - Stopped ServerConnector@2c1f8dbd{HTTP/1.1,[http/1.1]}{0.0.0.0:8083}
2019-03-08T10:18:50,580 INFO [Thread-60] org.eclipse.jetty.server.session - node0 Stopped scavenging
2019-03-08T10:18:50,582 INFO [Thread-60] org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@4792f119{/,null,UNAVAILABLE}
2019-03-08T10:18:50,587 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.metrics.MonitorScheduler.stop()] on object[org.apache.druid.java.util.metrics.MonitorScheduler@33379242].
2019-03-08T10:18:50,587 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.client.cache.CaffeineCache.close() throws java.io.IOException] on object[org.apache.druid.client.cache.CaffeineCache@41d5b40b].
2019-03-08T10:18:50,589 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.emitter.service.ServiceEmitter.close() throws java.io.IOException] on object[ServiceEmitter{serviceDimensions={service=druid/historical, host=localhost:8083, version=}, emitter=LoggingEmitter{log=Logger{name=[org.apache.druid.java.util.emitter.core.LoggingEmitter], class[class org.apache.logging.slf4j.Log4jLogger]}, level=INFO}}].
2019-03-08T10:18:50,590 INFO [Thread-60] org.apache.druid.java.util.emitter.core.LoggingEmitter - Close: started [false]
2019-03-08T10:18:50,590 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.emitter.core.LoggingEmitter.close()] on object[LoggingEmitter{log=Logger{name=[org.apache.druid.java.util.emitter.core.LoggingEmitter], class[class org.apache.logging.slf4j.Log4jLogger]}, level=INFO}].
2019-03-08T10:18:50,590 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.announcement.Announcer.stop()] on object[org.apache.druid.curator.announcement.Announcer@77fa9381].
2019-03-08T10:18:50,590 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - Stopping announcer
2019-03-08T10:18:50,590 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/segments/localhost:8083/localhost:8083_historical__default_tier_2019-03-08T10:18:33.051Z_65e0c464839244848b4c4a536e9e490d0]
2019-03-08T10:18:50,597 INFO [Thread-60] org.apache.druid.curator.CuratorModule - Stopping Curator
2019-03-08T10:18:50,597 INFO [Curator-Framework-0] org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2019-03-08T10:18:50,603 INFO [Thread-60] org.apache.zookeeper.ZooKeeper - Session: 0x100009547d20002 closed
2019-03-08T10:18:50,603 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [INIT]
2019-03-08T10:18:50,603 INFO [main-EventThread] org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x100009547d20002
2019-03-08T10:18:50,603 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner.stop()] on object[org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner@705a8dbc].

after:

2019-03-08T10:33:29,348 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Lifecycle [module] running shutdown hook
2019-03-08T10:33:29,350 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [LAST]
2019-03-08T10:33:29,352 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeAnnouncer - Unannouncing [DiscoveryDruidNode{druidNode=DruidNode{serviceName='druid/historical', host='localhost', bindOnHost=false, port=-1, plaintextPort=8083, enablePlaintextPort=true, tlsPort=-1, enableTlsPort=false}, nodeType='HISTORICAL', services={dataNodeService=DataNodeService{tier='_default_tier', maxSize=10000000000, type=historical, priority=0}, lookupNodeService=LookupNodeService{lookupTier='__default'}}}].
2019-03-08T10:33:29,353 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/internal-discovery/HISTORICAL/localhost:8083]
2019-03-08T10:33:29,371 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeAnnouncer - Unannounced [DiscoveryDruidNode{druidNode=DruidNode{serviceName='druid/historical', host='localhost', bindOnHost=false, port=-1, plaintextPort=8083, enablePlaintextPort=true, tlsPort=-1, enableTlsPort=false}, nodeType='HISTORICAL', services={dataNodeService=DataNodeService{tier='_default_tier', maxSize=10000000000, type=historical, priority=0}, lookupNodeService=LookupNodeService{lookupTier='__default'}}}].
2019-03-08T10:33:29,371 INFO [Thread-60] org.apache.druid.server.initialization.jetty.JettyServerModule - Waiting 10000 ms for unannouncement to propagate.
2019-03-08T10:33:39,371 INFO [Thread-60] org.apache.druid.server.initialization.jetty.JettyServerModule - Stopping Jetty Server...
2019-03-08T10:33:39,386 INFO [Thread-60] org.eclipse.jetty.server.AbstractConnector - Stopped ServerConnector@3a0aaaf0{HTTP/1.1,[http/1.1]}{0.0.0.0:8083}
2019-03-08T10:33:39,387 INFO [Thread-60] org.eclipse.jetty.server.session - node0 Stopped scavenging
2019-03-08T10:33:39,390 INFO [Thread-60] org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@296edc75{/,null,UNAVAILABLE}
2019-03-08T10:33:39,400 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [NORMAL]
2019-03-08T10:33:39,400 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.listener.announcer.ListenerResourceAnnouncer.stop()] on object[org.apache.druid.query.lookup.LookupResourceListenerAnnouncer@2792b416].
2019-03-08T10:33:39,400 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/listeners/lookups/__default/http:localhost:8083]
2019-03-08T10:33:39,403 INFO [Thread-60] org.apache.druid.server.listener.announcer.ListenerResourceAnnouncer - Unannouncing start time on [/druid/listeners/lookups/__default/http:localhost:8083]
2019-03-08T10:33:39,403 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.query.lookup.LookupReferencesManager.stop()] on object[org.apache.druid.query.lookup.LookupReferencesManager@4570d7b6].
2019-03-08T10:33:39,403 INFO [Thread-60] org.apache.druid.query.lookup.LookupReferencesManager - LookupReferencesManager is stopping.
2019-03-08T10:33:39,403 INFO [LookupReferencesManager-MainThread] org.apache.druid.query.lookup.LookupReferencesManager - Lookup Management loop exited, Lookup notices are not handled anymore.
2019-03-08T10:33:39,404 INFO [Thread-60] org.apache.druid.query.lookup.LookupReferencesManager - LookupReferencesManager is stopped.
2019-03-08T10:33:39,404 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.discovery.DruidLeaderClient.stop()] on object[org.apache.druid.discovery.DruidLeaderClient@29050de5].
2019-03-08T10:33:39,404 INFO [Thread-60] org.apache.druid.discovery.DruidLeaderClient - Stopped.
2019-03-08T10:33:39,404 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.discovery.ServerDiscoverySelector.stop() throws java.io.IOException] on object[org.apache.druid.curator.discovery.ServerDiscoverySelector@5d94a2dc].
2019-03-08T10:33:39,406 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider.stop()] on object[org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider@7e4579c7].
2019-03-08T10:33:39,406 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider - stopping
2019-03-08T10:33:39,406 INFO [Thread-60] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider - stopped
2019-03-08T10:33:39,406 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.http.client.NettyHttpClient.stop()] on object[org.apache.druid.java.util.http.client.NettyHttpClient@5a917723].
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.coordination.ZkCoordinator.stop()] on object[org.apache.druid.server.coordination.ZkCoordinator@32eae6f2].
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.server.coordination.ZkCoordinator - Stopping ZkCoordinator for [DruidServerMetadata{name='localhost:8083', hostAndPort='localhost:8083', hostAndTlsPort='null', maxSize=10000000000, tier='_default_tier', type=historical, priority=0}]
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.server.coordination.SegmentLoadDropHandler.stop()] on object[org.apache.druid.server.coordination.SegmentLoadDropHandler@66de00f2].
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.server.coordination.SegmentLoadDropHandler - Stopping...
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.server.coordination.CuratorDataSegmentServerAnnouncer - Unannouncing self[DruidServerMetadata{name='localhost:8083', hostAndPort='localhost:8083', hostAndTlsPort='null', maxSize=10000000000, tier='_default_tier', type=historical, priority=0}] at [/druid/announcements/localhost:8083]
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/announcements/localhost:8083]
2019-03-08T10:33:39,434 INFO [Thread-60] org.apache.druid.server.coordination.SegmentLoadDropHandler - Stopped.
2019-03-08T10:33:39,435 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.metrics.MonitorScheduler.stop()] on object[org.apache.druid.java.util.metrics.MonitorScheduler@33379242].
2019-03-08T10:33:39,435 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.client.cache.CaffeineCache.close() throws java.io.IOException] on object[org.apache.druid.client.cache.CaffeineCache@4084ee8].
2019-03-08T10:33:39,439 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.emitter.service.ServiceEmitter.close() throws java.io.IOException] on object[ServiceEmitter{serviceDimensions={service=druid/historical, host=localhost:8083, version=}, emitter=LoggingEmitter{log=Logger{name=[org.apache.druid.java.util.emitter.core.LoggingEmitter], class[class org.apache.logging.slf4j.Log4jLogger]}, level=INFO}}].
2019-03-08T10:33:39,439 INFO [Thread-60] org.apache.druid.java.util.emitter.core.LoggingEmitter - Close: started [false]
2019-03-08T10:33:39,439 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.java.util.emitter.core.LoggingEmitter.close()] on object[LoggingEmitter{log=Logger{name=[org.apache.druid.java.util.emitter.core.LoggingEmitter], class[class org.apache.logging.slf4j.Log4jLogger]}, level=INFO}].
2019-03-08T10:33:39,440 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.curator.announcement.Announcer.stop()] on object[org.apache.druid.curator.announcement.Announcer@77fa9381].
2019-03-08T10:33:39,440 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - Stopping announcer
2019-03-08T10:33:39,440 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/segments/localhost:8083/localhost:8083_historical__default_tier_2019-03-08T10:33:15.556Z_8f9ee73fede947448b9f0f687490281b0]
2019-03-08T10:33:39,446 INFO [Thread-60] org.apache.druid.curator.CuratorModule - Stopping Curator
2019-03-08T10:33:39,447 INFO [Curator-Framework-0] org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2019-03-08T10:33:39,451 INFO [Thread-60] org.apache.zookeeper.ZooKeeper - Session: 0x100009547d20006 closed
2019-03-08T10:33:39,451 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle - Stopping lifecycle [module] stage [INIT]
2019-03-08T10:33:39,451 INFO [main-EventThread] org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x100009547d20006
2019-03-08T10:33:39,451 INFO [Thread-60] org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner.stop()] on object[org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner@705a8dbc].

…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle
Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Seems like a reasonable solution to the problem.

@gianm gianm merged commit 5cc1714 into apache:master Mar 9, 2019
gianm pushed a commit to implydata/druid-public that referenced this pull request Mar 9, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
@clintropolis clintropolis deleted the jetty-lifecycle-stuff branch March 10, 2019 01:05
gianm pushed a commit to implydata/druid-public that referenced this pull request Mar 11, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
@gianm
Copy link
Copy Markdown
Contributor

gianm commented Mar 11, 2019

@clintropolis - I just realized that this may not actually solve the problem. It fixes one problem (Jetty stopping before the lookups module) but, I think, introduces another one. In the "after" log, Jetty stops before the historical unannounces itself fully:

2019-03-08T10:33:29,371 INFO [Thread-60] org.apache.druid.server.initialization.jetty.JettyServerModule - Waiting 10000 ms for unannouncement to propagate.
2019-03-08T10:33:39,371 INFO [Thread-60] org.apache.druid.server.initialization.jetty.JettyServerModule - Stopping Jetty Server...
2019-03-08T10:33:39,386 INFO [Thread-60] org.eclipse.jetty.server.AbstractConnector - Stopped ServerConnector@3a0aaaf0{HTTP/1.1,[http/1.1]}{0.0.0.0:8083}
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.server.coordination.CuratorDataSegmentServerAnnouncer - Unannouncing self[DruidServerMetadata{name='localhost:8083', hostAndPort='localhost:8083', hostAndTlsPort='null', maxSize=10000000000, tier='_default_tier', type=historical, priority=0}] at [/druid/announcements/localhost:8083]
2019-03-08T10:33:39,430 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/announcements/localhost:8083]
2019-03-08T10:33:39,440 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - Stopping announcer
2019-03-08T10:33:39,440 INFO [Thread-60] org.apache.druid.curator.announcement.Announcer - unannouncing [/druid/segments/localhost:8083/localhost:8083_historical__default_tier_2019-03-08T10:33:15.556Z_8f9ee73fede947448b9f0f687490281b0]

Since the server is still announced in a way that the Broker ServerView can see, queries will keep coming in to it even after Jetty is stopped. To address this, I believe the SegmentLoadDropHandler, which manages the /druid/announcements announcement, needs to stop before the Jetty server does.

gianm added a commit to implydata/druid-public that referenced this pull request Mar 11, 2019
…hutdown to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)"

This reverts commit 028d9e9.
@clintropolis clintropolis restored the jetty-lifecycle-stuff branch March 11, 2019 19:42
@clintropolis clintropolis deleted the jetty-lifecycle-stuff branch March 11, 2019 19:54
@clintropolis
Copy link
Copy Markdown
Member Author

Yes, this is correct for curator based segment discovery, I will resolve the issue in a follow-up PR.

gianm added a commit to implydata/druid-public that referenced this pull request Mar 11, 2019
…hutdown to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)"

This reverts commit 4696363.
gianm pushed a commit to implydata/druid-public that referenced this pull request Mar 14, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
@gianm gianm added this to the 0.15.0 milestone Mar 29, 2019
gianm pushed a commit to implydata/druid-public that referenced this pull request Apr 8, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
gianm pushed a commit to implydata/druid-public that referenced this pull request Apr 14, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants