Race condition in LocalMethod: handler called before activation is finished
|Assignee:||J. Wienke||% Done:|
Sometimes (1 of 20 test-runs) we get this internal rsb exception.
Exception in thread "Thread-6751" java.lang.IllegalStateException: send(Event) cannot be called in state StateInactive 19 at rsb.Informer$State.send(Informer.java:89) 20 at rsb.Informer.publish(Informer.java:306) 21 at rsb.patterns.LocalMethod.internalNotify(LocalMethod.java:128) 22 at rsb.eventprocessing.SingleThreadEventReceivingStrategy$DispatchThread.run(SingleThreadEventReceivingStrategy.java:98)
The informer seems to be not initialized but the internalNotify method does not check the isActive state.
After this exception occurs rsb events get lost. Seems that any internal handler thread is killed afterwards.
Change order listener and informer activation in Method
This change shall ensure that for LocalMethods the informer is always
ready, even if the main activation hasn't completed, because the
Listener might start to receive requests in this moment.
This might be an explanation for refs #2580, but seems quite unlikely.
#1 Updated by J. Wienke over 6 years ago
- Subject changed from internalNotify results in IllegalStateException in some cases to Race condition in LocalMethod: handler called before activation is finished
- Status changed from New to In Progress
- Assignee set to J. Wienke
The handler of the listener is registered before the informer is activated and the activate method has finished. Therefore the method might be called before it can actually send replies.
#2 Updated by J. Wienke over 6 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset rsb-java|024ebfb31d4642d5e3ec9bf610e2596845be8637.