dsccommunity / dsccommunity/SharePointDsc

SPDistributedCacheService - Resource takes to long and does not complete correctly

Open
#786 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
C#
Stars
246
Forks
106
PR merge metrics
No merged PRs in 30d

Description

Using the SPDistributedCacheService instance to provision a Distributed Cache on a server takes way to long and does not complete correctly. The service instance is stuck in the unprovisioning state after the resource is run.

After a quick look into the resource I came across this command:
https://github.com/PowerShell/SharePointDsc/blob/4e9e1216da0412ac206889729e8f791bb51b79f5/Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/MSFT_SPDistributedCacheService.psm1#L249-L251

I tried to change it to Stop-SPDistributedCacheServiceInstance and the service instance gets stopped immediately.

Is there any reason to use Stop-SPServiceInstance instead of Stop-SPDistributedCacheServiceInstance?

Update:
I did a quick check of the PowerShell Methods used to stop the service.

Stop-SPDistributedCacheServiceInstance cmdlet uses the internal method: Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheServiceInstance.UnProvisionInternal() to stop the service.

Stop-SPServiceInstance cmdlet calls the public method Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheServiceInstance.Unprovision() wich will also call the internal one.

I do not see, why there is a difference in the execution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Modules/SharePointDsc/DSCResources/MSFT_SPDistributedCacheService/MSFT_SPDistributedCacheService.psm1 at lines 249-251 and compare the two service-stop commands mentioned in the issue. Reproduce the distributed-cache provisioning run, then verify that the resource completes and the service instance does not remain in the unprovisioning state.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.