[jboss-jira] [JBoss JIRA] (WFCORE-4291) Restore legacy (not "graceful") startup mode

Brad Maxwell (Jira) issues at jboss.org
Thu Feb 13 20:57:00 EST 2020


    [ https://issues.redhat.com/browse/WFCORE-4291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13971735#comment-13971735 ] 

Brad Maxwell edited comment on WFCORE-4291 at 2/13/20 8:56 PM:
---------------------------------------------------------------

This is more of a feature request than a fix.  The not graceful startup mode option would introduce possible race issues allowing external requests before everything is started.  As a workaround you can currently register an mbean notification 

{code}
  @Override
  public void handleNotification(Notification notification, Object handback) {
    // Make sure the Thread Context ClassLoader is correct since this is an MBean Callback
    ClassLoader previous = Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(StartedNotificationListener.class.getClassLoader());
      AttributeChangeNotification attributeChangeNotification = (AttributeChangeNotification) notification;
      if ("RuntimeConfigurationState".equals(attributeChangeNotification.getAttributeName())) {
        if (notification.getSequenceNumber() == 4) {
          log.info("Invoking callback");
          getManagedExecutorService().submit(new Runnable() {
            public void run() {
                // invoke http or other external request
            }
          });
        }
    } catch (Throwable e) {
      e.printStackTrace();
    } finally {
      Thread.currentThread().setContextClassLoader(previous);
    }
  }
{code}

[1] https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/html/configuration_guide/jboss_eap_management#server_lifecycle_event_notifications


was (Author: bmaxwell):
This is more of a feature request than a fix.  The not graceful startup mode option would introduce possible race issues allowing external requests before everything is started.  As a workaround you can currently register an mbean notification 

{code}
  @Override
  public void handleNotification(Notification notification, Object handback) {
    // Make sure the Thread Context ClassLoader is correct since this is an MBean Callback
    ClassLoader previous = Thread.currentThread().getContextClassLoader();
    try {
      Thread.currentThread().setContextClassLoader(StartedNotificationListener.class.getClassLoader());
      AttributeChangeNotification attributeChangeNotification = (AttributeChangeNotification) notification;
      if ("RuntimeConfigurationState".equals(attributeChangeNotification.getAttributeName())) {
        if (notification.getSequenceNumber() == 4 && callback != null) {
          log.info("Invoking callback");
          getManagedExecutorService().submit(new Runnable() {
            public void run() {
                // invoke http or other external request
            }
          });
        }
    } catch (Throwable e) {
      e.printStackTrace();
    } finally {
      Thread.currentThread().setContextClassLoader(previous);
    }
  }
{code}

[1] https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/html/configuration_guide/jboss_eap_management#server_lifecycle_event_notifications

> Restore legacy (not "graceful") startup mode
> --------------------------------------------
>
>                 Key: WFCORE-4291
>                 URL: https://issues.redhat.com/browse/WFCORE-4291
>             Project: WildFly Core
>          Issue Type: Feature Request
>          Components: Management
>            Reporter: Vladimir Grabarchuk
>            Assignee: Brian Stansberry
>            Priority: Major
>
> Please allow a configurable legacy startup mode which was the default before WF11, when components can service HTTP requests as soon as they are deployed, not when the container deploys all components.
> The use case for this is the following: there is a configuration service component upon which other components depend for configuration data, requested and served via a HTTP request. With the new "graceful startup" this scenario no longer seems possible,  as it results in read timeouts, mis-configured artifacts, and failed deployments altogether.
> If generally feasible, another value of the *--start-mode=legacy* seems appropriate to accommodate the original (legacy) behavior.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list