Skip to content

Commit

Permalink
Fix for GetClaimedRepair Tasks and add Version Information to generat…
Browse files Browse the repository at this point in the history
…ed binaries. (#78)

* Try catch and versioning of dlls

* Change POA version
  • Loading branch information
Saket Harsh authored Jan 13, 2021
1 parent 2412599 commit f42c2c0
Show file tree
Hide file tree
Showing 22 changed files with 206 additions and 50 deletions.
4 changes: 2 additions & 2 deletions arm/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"contentVersion": "1.0.0.0",
"parameters": {
"appPackageUrl": {
"defaultValue": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.8/PatchOrchestrationApplication_v1.4.8.sfpkg",
"defaultValue": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.9/PatchOrchestrationApplication_v1.4.9.sfpkg",
"metadata": {
"description": "The URL to the application package sfpkg file. example: https://github.com/microsoft/Service-Fabric-POA/releases/download/{{version}}/PatchOrchestrationApplication_{{version}}.sfpkg"
},
"type": "String"
},
"applicationTypeVersion": {
"defaultValue": "1.4.8",
"defaultValue": "1.4.9",
"metadata": {
"description": "The application type version."
},
Expand Down
4 changes: 2 additions & 2 deletions arm/template.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"contentVersion": "1.0.0.0",
"parameters": {
"appPackageUrl": {
"value": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.8/PatchOrchestrationApplication_v1.4.8.sfpkg"
"value": "https://github.com/microsoft/Service-Fabric-POA/releases/download/v1.4.9/PatchOrchestrationApplication_v1.4.9.sfpkg"
},
"applicationTypeVersion": {
"value": "1.4.8"
"value": "1.4.9"
},
"clusterName": {
"value": "{{cluster name}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@
<IsServiceFabricServiceProject>true</IsServiceFabricServiceProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric.Data" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric" Version = "6.4.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version = "3.3.654"/>
<PackageReference Include="Newtonsoft.Json" Version = "6.0.4"/>
<PackageReference Include="Microsoft.Owin" Version = "2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.Owin.Hosting" Version="2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="CommonServiceLocator" Version = "1.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Unity" Version = "4.0.1" Culture="neutral" PublicKeyToken="6d32ff45e0ccc69f" processorArchitecture="MSIL"/>
<PackageReference Include="Owin" Version = "1.0" Culture="neutral" PublicKeyToken="f0ebd12fd5e55cc5" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="3.3.654" />
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.654" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.654" />
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="3.3.654" />
<PackageReference Include="Newtonsoft.Json" Version="6.0.4" />
<PackageReference Include="Microsoft.Owin" Version="2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="2.0.2" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<PackageReference Include="CommonServiceLocator" Version="1.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<PackageReference Include="Unity" Version="4.0.1" Culture="neutral" PublicKeyToken="6d32ff45e0ccc69f" processorArchitecture="MSIL" />
<PackageReference Include="Owin" Version="1.0" Culture="neutral" PublicKeyToken="f0ebd12fd5e55cc5" processorArchitecture="MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version = "5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Serialization" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version = "5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version = "5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL"/>
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.2.3" Culture="neutral" PublicKeyToken="31bf3856ad364e35" processorArchitecture="MSIL" />
<Reference Include="System.Xml" />
<PackageReference Include="Unity.WebAPI" Version = "5.2.3" Culture="neutral" PublicKeyToken="43da31bc42a85347" processorArchitecture="MSIL"/>
<PackageReference Include="Unity.WebAPI" Version="5.2.3" Culture="neutral" PublicKeyToken="43da31bc42a85347" processorArchitecture="MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebService\IWebServiceAppBuilder.cs" />
<Compile Include="WebService\Startup.cs" />
<Compile Include="WebService\DefaultController.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="CoordinatorServicePkg"
Version="1.4.8"
Version="1.4.9"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Expand All @@ -11,7 +11,7 @@
</ServiceTypes>

<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.4.8">
<CodePackage Name="Code" Version="1.4.9">
<EntryPoint>
<ExeHost>
<Program>CoordinatorService.exe</Program>
Expand All @@ -21,7 +21,7 @@

<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.4.8" />
<ConfigPackage Name="Config" Version="1.4.9" />

<Resources>
<Endpoints>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.ServiceFabric.PatchOrchestration.CoordinatorService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Inc.")]
[assembly: AssemblyProduct("Microsoft.ServiceFabric.PatchOrchestration.CoordinatorService")]
[assembly: AssemblyCopyright("Copyright © Microsoft Inc. 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bbbc23a5-1439-4fbf-84e1-c26c23d4aec1")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.9")]
[assembly: AssemblyFileVersion("1.4.9")]
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,19 @@ internal async Task<bool> CheckRepairManagerStatus(CancellationToken cancellatio
/// <returns>List of repair tasks in claimed state</returns>
private async Task<IList<RepairTask>> GetClaimedRepairTasks(NodeList nodeList, CancellationToken cancellationToken)
{
IList<RepairTask> repairTasks = new List<RepairTask>();

IList<RepairTask> repairTasks = await this.fabricClient.RepairManager.GetRepairTaskListAsync(TaskIdPrefix,
RepairTaskStateFilter.Claimed,
ExecutorName, this.DefaultTimeoutForOperation, cancellationToken);

try
{
repairTasks = await this.fabricClient.RepairManager.GetRepairTaskListAsync(TaskIdPrefix,
RepairTaskStateFilter.Claimed,
ExecutorName, this.DefaultTimeoutForOperation, cancellationToken);
}
catch ( Exception ex)
{
ServiceEventSource.Current.VerboseMessage("Exception occured in fetching Repair Tasks from Fabric in GetClaimedRepairTasks. Exception- {0}", ex);
}

int claimedRepairTaskCount = repairTasks.Count;

IList<RepairTask> selectedRepairTasks = new List<RepairTask>();
Expand Down Expand Up @@ -180,9 +188,18 @@ private async Task<IList<RepairTask>> GetClaimedRepairTasks(NodeList nodeList, C

private async Task<IList<RepairTask>> GetCompletedRepairTasks(NodeList nodeList, CancellationToken cancellationToken)
{
IList<RepairTask> repairTasks = await this.fabricClient.RepairManager.GetRepairTaskListAsync(TaskIdPrefix,
IList<RepairTask> repairTasks = new List<RepairTask>();

try
{
repairTasks = await this.fabricClient.RepairManager.GetRepairTaskListAsync(TaskIdPrefix,
RepairTaskStateFilter.Completed,
ExecutorName, this.DefaultTimeoutForOperation, cancellationToken);
}
catch (Exception ex)
{
ServiceEventSource.Current.VerboseMessage("Exception occured in fetching Repair Tasks from Fabric in GetCompletedRepairTasks. Exception- {0}", ex);
}

return repairTasks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<Compile Include="$(CommonRoot)\WindowsUpdateOperationResult.cs" />
<Compile Include="$(CommonRoot)\ExecutorData.cs" />
<Compile Include="$(CommonRoot)\SerializationUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility\NodeAgentSfUtility.cs" />
<Compile Include="Manager\WindowsUpdateManager.cs" />
<Compile Include="Manager\WUErrorCodes.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentNTService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Inc.")]
[assembly: AssemblyProduct("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentNTService")]
[assembly: AssemblyCopyright("Copyright © Microsoft Inc. 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("223c284c-5930-453e-89c0-0be1fdea4c04")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.9")]
[assembly: AssemblyFileVersion("1.4.9")]
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Runtime.Serialization" />
<PackageReference Include="Microsoft.ServiceFabric.Data" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric" Version = "6.4.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="3.3.654" />
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.654" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.654" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceEventSource.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Runtime.Serialization" />
<PackageReference Include="Microsoft.ServiceFabric.Data" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric" Version = "6.4.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version = "3.3.654"/>
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version = "3.3.654"/>
<PackageReference Include="Newtonsoft.Json" Version = "10.0.2"/>
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="3.3.654" />
<PackageReference Include="Microsoft.ServiceFabric" Version="6.4.654" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.3.654" />
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="3.3.654" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="CommandProcessor.cs" />
Expand All @@ -42,5 +42,8 @@
<Compile Include="Helpers\RepairManagerHelper.cs" />
<Compile Include="Helpers\ServiceEventSource.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentSFUtility")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Inc.")]
[assembly: AssemblyProduct("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentSFUtility")]
[assembly: AssemblyCopyright("Copyright © Microsoft Inc. 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("26069ca9-6b35-49f2-9775-23949a01394e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.9")]
[assembly: AssemblyFileVersion("1.4.9")]
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<Compile Include="NodeAgentService.cs" />
<Compile Include="NtServiceConfigurationUtility.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceEventSource.cs" />
<Compile Include="DirectoryUtility.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="NodeAgentServicePkg"
Version="1.4.8"
Version="1.4.9"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Expand All @@ -11,7 +11,7 @@
</ServiceTypes>

<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.4.8">
<CodePackage Name="Code" Version="1.4.9">
<SetupEntryPoint>
<ExeHost>
<Program>SetupEntryPoint.bat</Program>
Expand All @@ -27,7 +27,7 @@

<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.4.8" />
<ConfigPackage Name="Config" Version="1.4.9" />

<Resources>
<Endpoints>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft Inc.")]
[assembly: AssemblyProduct("Microsoft.ServiceFabric.PatchOrchestration.NodeAgentService")]
[assembly: AssemblyCopyright("Copyright © Microsoft Inc. 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6d1f2fa9-23e5-4153-9558-de376d7a65cd")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.9")]
[assembly: AssemblyFileVersion("1.4.9")]
Loading

0 comments on commit f42c2c0

Please sign in to comment.