[Design the new POJO MicroContainer] - Re: Concurrent deployments
by adrian@jboss.org
"bela(a)jboss.com" wrote : The MC's dependency management currently starts all services sequentially, according to their dependencies.
|
Actually some services, e.g. MDBs are started asynchronously,
but this is handled by the relevant container rather than the Micro-kernel/container.
anonymous wrote :
| In JBoss 4.3, we have 4 JGroups channels, which take 5 secs *each* to start. However, they are completely independent from each other, so they could be started concurrently. This would bring the time needed down from 20 secs to 5 secs.
|
| I imagine we could do this for all independent services, a.k.a subtrees in the dependency tree. This would speed up start of JBoss significantly !
|
| Can we do this ?
|
This question has been asked many times before.
The answer is in principle yes, but in practice no.
The main the practicality problems are:
* Not all services define their dependencies properly. It's only the implicit
sequential order that makes them work correctly.
* The Sun classloading doesn't work very well concurrently. We avoid a number
of potential problems by doing a sequential load of most of the key classes
during the bootstrap.
We have workarounds, but you can still see these issues on some
platforms.
* The "big ball of mud" unified classloader depends for consistency/predictability
on having the classloaders created in order. It is this order that is used to
search for global classes. If these were registered concurrently across threads
the search order would be unpredicatble across different reboots.
In fact, 4.x has no mechanism for classloading dependency at all.
* The old 4.x MicroKernel has some thread safety issues,
e.g. invocations of create/start are done in synchronized blocks which could
cause deadlock problems, there are others related to ConcurrentModificationExceptions.
This is not an issue with the 5.x Microcontainer.
* We'd need to find a way for the BarrierService and "Server Started" notification
to know when all the startup threads have finished, otherwise
they would be broken.
* Finally, less of a practical issue, but more a generic note. Using mulitple threads
for startup will only work if there are multiple cpus/cores. In non SMP environments
the bootstrap could be slower with multiple competing threads, although
it may be able to take advantage of times during disk I/O waits
to do some processing on other threads?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128809#4128809
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128809
18 years, 1 month
[Design of JCA on JBoss] - Re: JBAS-5229 - Feature request - Atomic redeploy of connect
by adrian@jboss.org
"dsmiley" wrote : Perhaps you could suspend new transactions from being acquired until the existing transactions complete, then switch the datasource, then resume the transactions?
|
Transactions can last a long time. e.g. the default timeout is 5 minutes.
We aren't going to suspend all database activity on all threads for 5 minutes because
of one long running transaction using the old datasource. ;-)
anonymous wrote :
| And when I mentioned closing down the datasource, then obviously that will entail closing any connections pooled therein.
|
We already do that. In fact, we do better. Although the previous datasource
is shutdown, transactions can continue with the connections until they finish with them
and then we close the real connection when the transaction commits.
See the flushing part here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIChangeThePoolingParameters
What is not allowed is to make new getConection() requests from the shutdown
datasource.
In general, this "feature" would be best handled by the application retrying the request
from the beginning of the transaciton.
If you closed the connection and want to re-aquire one in the same jdbc transaction
after the datasource is "gone", then your transaction is broken.
The connection manager can't really satisfy your request (unless we add
extra code to hand-off to the new connection manager described above).
The solution is to rollback the transaction and restart with a new transaction and a
new connection from the new datasource.
In general only the application knows where the transaction starts,
although the container can know for CMT if you tell it what
exceptions are "retryable":
http://wiki.jboss.org/wiki/Wiki.jsp?page=RetryingTransactions
Of course, if the datasource is not transactional then this feature would make sense.
There is no need for a correlation between two different getConnection() requests,
there is not global transaction.
But then again you don't really see the problem if you don't cache the datasource between
the two getConnection() requests.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128755#4128755
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128755
18 years, 1 month