polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niclas Hedhman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (POLYGENE-106) Investigate and Document the exact lifecycle of Services
Date Tue, 11 Apr 2017 07:15:41 GMT

    [ https://issues.apache.org/jira/browse/POLYGENE-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15963948#comment-15963948

Niclas Hedhman commented on POLYGENE-106:

Thinking about this for another 2 seconds, I wonder if we should define a threading model
for services, since that is where the problem lies.

Perhaps the issue is actually that "instantiateOnStartup" and activation are blurring the
actual usecase that one is looking for.

instantiateOnStartup is not very Polygene-like naming, as it describes a mechanism instead
of a goal. The goal is along the way that it is a "root service", "autonomous service", "worker"
or something along those lines, and that requires instantiation and activation, but would
it not also imply its own thread?

It is these services that gets applications going typically, so there is more to this story
than we have recognized in the past. Let's find the right names and patterns for 3.0

> Investigate and Document the exact lifecycle of Services
> --------------------------------------------------------
>                 Key: POLYGENE-106
>                 URL: https://issues.apache.org/jira/browse/POLYGENE-106
>             Project: Polygene
>          Issue Type: Bug
>            Reporter: Niclas Hedhman
> The Bootstrap is required to be single-threaded, no concurrency measures are present,
and any multi-threaded code executing before the application has been activated, is deemed
"undefined" and "potentially fatal".
> But, services are allowed to be lazy-instantiated, which is even the default, which means
that their activation must be fully thread-safe, including the new activation/passivation
system for services. POLYGENE-39 might indicate that the initialize() method hadn't been executed
in full, before another thread is granted access to the FileEntityStore, causing "slices==0"
and a DivideByZero exception to be thrown.
> I think it is essential that the exact details and locks involved, are fully investigated
and documented to understand what happens during the instantiation/activation/initialization
phase of a service, long after the application has been activated.

This message was sent by Atlassian JIRA

View raw message