VirtualBox

Changeset 40568 in vbox for trunk


Ignore:
Timestamp:
Mar 21, 2012 4:11:19 PM (13 years ago)
Author:
vboxsync
Message:

Main/Metrics: Fix for multiple metrics configuration in one call (#6029)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/Performance.cpp

    r40536 r40568  
    490490     * guest metrics collection, so we rely on this fact to detect blocked
    491491     * guests. If the guest has not finished processing the previous request
    492      * we consider it blocked.
     492     * after half a second we consider it blocked.
    493493     */
    494494    if (aRequest->getGuest() && aRequest->getGuest() == mGuestBeingCalled)
    495495    {
    496         /* Request execution got stalled for this guest -- report an error */
    497         return E_FAIL;
     496        /*
     497         * Before we can declare a guest blocked we need to wait for a while
     498         * and then check again as it may never had a chance to process
     499         * the previous request. Half a second is an eternity for processes
     500         * and is barely noticable by humans.
     501         */
     502        LogAleksey(("{%p} " LOG_FN_FMT ": Suspecting %s is stalled. Waiting for .5 sec...\n",
     503                    this, __PRETTY_FUNCTION__,
     504                    aRequest->getGuest()->getVMName().c_str()));
     505        RTThreadSleep(500 /* ms */);
     506        if (aRequest->getGuest() == mGuestBeingCalled) {
     507            LogAleksey(("{%p} " LOG_FN_FMT ": Request processing stalled for %s\n",
     508                        this, __PRETTY_FUNCTION__,
     509                        aRequest->getGuest()->getVMName().c_str()));
     510            /* Request execution got stalled for this guest -- report an error */
     511            return E_FAIL;
     512        }
    498513    }
    499514    mQueue.push(aRequest);
     
    509524    HRESULT rc = S_OK;
    510525
    511     LogAleksey(("{%p} " LOG_FN_FMT ": Starting request processing loop...p\n",
     526    LogAleksey(("{%p} " LOG_FN_FMT ": Starting request processing loop...\n",
    512527                mgr, __PRETTY_FUNCTION__));
    513528    while ((pReq = mgr->mQueue.pop()) != NULL)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette