Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12085

ThreadPool metrics register after all components start

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Ignite Flags:
      Docs Required

      Description

      For now, thread pool metrics register after all GridComponent starts.

      But there are specific scenarios when some component blocks onKernalStart execution for a long time. GridCacheProcessor can be taken as an example.

      This leads to the situation when some metric info is lost.

      Seems, we can register thread pool metrics right after only *required* components are started and don't wait for all components.

                  // Callbacks.
                  for (GridComponent comp : ctx) {
                      comp.onKernalStart(active);
                  }
      
                  // Start plugins.
                  for (PluginProvider provider : ctx.plugins().allProviders())
                      provider.onIgniteStart();
      
                  ctx.metric().registerThreadPools(utilityCachePool, execSvc, svcExecSvc, sysExecSvc, stripedExecSvc,
                      p2pExecSvc, mgmtExecSvc, igfsExecSvc, dataStreamExecSvc, restExecSvc, affExecSvc, idxExecSvc,
                      callbackExecSvc, qryExecSvc, schemaExecSvc, rebalanceExecSvc, rebalanceStripedExecSvc, customExecSvcs);
      
                  // Register MBeans.
                  mBeansMgr.registerAllMBeans(utilityCachePool, execSvc, svcExecSvc, sysExecSvc, stripedExecSvc, p2pExecSvc,
                      mgmtExecSvc, igfsExecSvc, dataStreamExecSvc, restExecSvc, affExecSvc, idxExecSvc, callbackExecSvc,
                      qryExecSvc, schemaExecSvc, rebalanceExecSvc, rebalanceStripedExecSvc, customExecSvcs, ctx.workersRegistry());
      
      
      public class GridCacheProcessor {
          @Override public void onKernalStart(boolean active) throws IgniteCheckedException {
      //.....
              final List<IgniteInternalFuture> syncFuts = new ArrayList<>(caches.size());
      
              sharedCtx.forAllCaches(new CIX1<GridCacheContext>() {
                  @Override public void applyx(GridCacheContext cctx) {
                      CacheConfiguration cfg = cctx.config();
      
                      if (cctx.affinityNode() &&
                          cfg.getRebalanceMode() == SYNC &&
                          startTopVer.equals(cctx.startTopologyVersion())) {
                          CacheMode cacheMode = cfg.getCacheMode();
      
                          if (cacheMode == REPLICATED || (cacheMode == PARTITIONED && cfg.getRebalanceDelay() >= 0))
                              // Need to wait outside to avoid a deadlock
                              syncFuts.add(cctx.preloader().syncFuture());
                      }
                  }
              });
      
              for (int i = 0, size = syncFuts.size(); i < size; i++)
                  syncFuts.get(i).get();
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nizhikov Nikolay Izhikov
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: