Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Admin API - is it thread safe?


Is it safe to use org.openspaces.admin.internal.admin.DefaultAdmin (implementation of org.openspaces.admin.Admin) by multiple threads at the same time?


asked 2017-09-13 10:17:58 -0500

mariuszb gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted


The Admin is not thread safe. If you have more than one Admin for a period of time that is fine but keeping 2 or more up is not a good practise. Why do you need more than one?

answered 2017-09-14 03:06:20 -0500

Yuval gravatar image
edit flag offensive delete link more


Mostly for grid startup. We have about one hundred processing units we need to deploy and doing it sequentially takes too much time. So if we want to do multiple deployments at the same time we need to guarantee synchronized access to Admin, right? Do you have any better suggestions?

mariuszb gravatar image mariuszb  ( 2017-09-14 03:35:50 -0500 )edit

This might cause the PUs to spread unbalanced on the cluster and don't think that will reduce the development time. In case you are using the gs command then moving even to one Admin might reduce the deployment time as the gs command contain some sleeps inside. In 12.2 we have added new algorithm fits to large cluster that reduce the deployment time by saving networking between the GSM and PUs

Yuval gravatar image Yuval  ( 2017-09-14 04:13:38 -0500 )edit

@Yuval, deployment time is definitely smaller as more GSCs can be starting PUs at the same time. From our experience parallelization makes sense up to number of GSCs (4 GSCs -> 4 simultaneous deployments), if we use more we can see some provisioning errors in logs (but in the end everything gets deployed).

mariuszb gravatar image mariuszb  ( 2017-09-14 06:28:31 -0500 )edit

The provisioning errors might be related to that fact that the Admin is not thread safe.

Yuval gravatar image Yuval  ( 2017-09-17 04:30:40 -0500 )edit

Thanks @Yuval

A bit more specific questions:

1) We're deploying GSCs in multiple threads in order to reduce platform startup time, following piece of code is executed:


We didn't notice any issues or side effects of that. Is it safe for prod use?

2) If we want to deploy multiple PUs at the same time - will it be safer to use multiple AdminAPI instances or in general we should do it in single thread? Related code:

mariuszb gravatar image mariuszb  ( 2017-09-19 03:11:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-09-13 10:17:58 -0500

Seen: 393 times

Last updated: Sep 14 '17