[ 
https://issues.apache.org/jira/browse/IGNITE-2708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202396#comment-15202396
 ] 

Valentin Kulichenko commented on IGNITE-2708:
---------------------------------------------

Hi, is there any reason why it's implemented not in the way it is described in 
the ticket? The purpose of this task is to make sure that {{spiStart}} is never 
called more than once on the same instance. I don't like setting the flag in 
{{injectResources}} method instead, this looks like a dirty hack.

In addition two nodes with the same SPI instance can be started concurrently. 
You solution is not thread-safe and doesn't work in this scenario. You may want 
to use {{AtomicBoolean.compareAndSet}} here instead of non-volatile boolean 
variable.

> Need to validate that SPIs are started only once
> ------------------------------------------------
>
>                 Key: IGNITE-2708
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2708
>             Project: Ignite
>          Issue Type: Improvement
>          Components: general
>            Reporter: Valentin Kulichenko
>            Assignee: Ryan Zhao
>              Labels: newbie, usability
>
> User forum discussion: 
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-instance-hangs-during-restart-in-client-mode-td3101.html
> If one uses the same instance of {{IgniteConfiguration}} more than once, it 
> doesn't work because SPIs have lifecycle and can be started only once. 
> Currently this causes hang on start which is counterintuitive.
> We should add a validation step to {{GridSpiAdapter}} that will check that 
> the SPI was never started before. Its {{spiStart()}} method should set some 
> flag there or throw exception if it has already been set. All internal SPI 
> implementations should be changed to call {{super.spiStart()}} as first 
> statement.



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

Reply via email to