Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14965

Ignite is in invalid state when trying to use Ignite as a Spring bean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.10
    • None
    • spring
    • None
    • Docs Required, Release Notes Required

    Description

      The following use-case leads to temporary invalid state errors at the grid startup time:

      Ignite node has an Ignite Service with Ignite DI being used to inject into that service a Spring-managed bean, which in its turn depends on the Ignite instance, namely the IgniteSpringBean instance. Invoke any method of the bean that uses the Ignite instance from the execute method of the service.

      Result: IllegalStateException "Ignite is in invalid state to perform this operation".

      The root cause is that Ignite Services initialization and execution may happen before IgniteSpringBean#afterSingletonInstantiated returns and the inner g variable gets initialized. Please note that even if the g variable gets initialized before any Ignite Service starts executing, a spring-managed bean may still get the exception as the inner g variable is not volatile and other threads may observe the outdated value for some small amount of time.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ivan.fedorenkov Ivan Fedorenkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: