none
CloseSession throws NullReferenceException

    Frage

  • Hi,

    I am working a service running on HPC 2016 Update 1.

    From client node, I am able to submit task and task finished. But task stayed on running state. Checking the event log, I can see there is null reference exception. 

    Further investigating, I found the null reference exception is raised in CloseSession. The stack trace is:

       at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
       at Microsoft.Hpc.Scheduler.Session.V3Session.CloseSession(String headNode, Int32 sessionId, Binding binding, Boolean isAadUser)
       at Microsoft.Hpc.Scheduler.Session.Session.CloseSession(String headnode, Int32 sessionId, Boolean isAadUser)

       at user code to call CloseSession.

    The exception source is: Microsoft.Threading.Tasks.

    Microsoft.Threading.Tasks version is 1.0.168.0

    HPC SDK version 5.1.6124.

    May I get some suggestions? Thanks.


    Mittwoch, 10. Oktober 2018 19:31

Alle Antworten

  • Hi,

    What binding are you used in you SOA service? Which version of .net framework you are using?

    Thanks,
    Zihao

    Donnerstag, 11. Oktober 2018 02:27
  • <system.serviceModel>
        <bindings>
          <netTcpBinding>
            <binding name="myBinding"
                     receiveTimeout="24.00:00:00"
                     portSharingEnabled="true"
                     maxBufferSize="262144"
                     maxReceivedMessageSize="262144">
              <security mode="Transport" />
              <readerQuotas maxStringContentLength="65536" />
            </binding>
            <!--binding used by broker's backend-->
            <binding name="Microsoft.Hpc.BackEndBinding" maxConnections="1000">
              <!--for non domain joined compute nodes, the security mode should be None-->
              <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="None"/>
              </security>
            </binding>
          </netTcpBinding>
        </bindings>
      </system.serviceModel>

    netTcpBinding is what we used for HPC 2008 and HPC 2012. BackEndBinding is what I added for HPC 2016 (I have to add them for some HPC regression).

    Our code is compiled in VS 2010. The target framework is .NET Framework4.

    Donnerstag, 11. Oktober 2018 14:17
  • Hi,

    We can not locally reproduce this issue. Could you add following xml to your app.config, and provide us the log produced?

      <system.diagnostics>
    	<trace autoflush="true" useGlobalLock="false">
    		<listeners>
    			<remove name="Default" />
    			<add name="xmlt" />
    		</listeners>
    	</trace>
    	<sharedListeners>
    		<add name="xmlt" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\TEMP\trace.svclog" />
    		<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\TEMP\session.svclog" />
    		<add name="xmls" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\TEMP\hpcsoa.svclog" />
    	</sharedListeners>
    	<sources>
    		<source name="SOA Session API" switchValue="All">
    			<listeners>
    				<remove name="Default" />
    				<add name="xml"/>
    			</listeners>
    		</source>    
    		<source name="HpcSoa" switchValue="All">
    			<listeners>
    				<remove name="Default" />
    				<add name="xmls" />
    			</listeners>
    		</source>
    	</sources>
      </system.diagnostics>

    Thanks,

    Zihao

    Freitag, 12. Oktober 2018 04:06