idies / pyJHTDB

Python wrapper for the Johns Hopkins turbulence database library
Apache License 2.0
96 stars 47 forks source link

Timeout error while running on SciServer #37

Open danjruth opened 2 years ago

danjruth commented 2 years ago

Hi,

I'm trying to run the following code on SciServer:

import numpy as np
from pyJHTDB import libJHTDB

lJHTDB = libJHTDB()
lJHTDB.initialize(exit_on_error=True)
lJHTDB.add_token(r'my-token-here') # commenting this line out does not seem to make a difference

while True:

    t = np.random.uniform(0,10.0)
    n_pts = 50
    x = np.random.uniform(0,2*np.pi,size=(n_pts,3))

    vel = lJHTDB.getData(t,point_coords=x.astype(np.float32), getFunction='getVelocity', sinterp='Lag4', tinterp='PCHIPInt')
    print('got velocity successfully')

It'll occasionally make it through the while loop successfully, but hasn't done so more than ~5 times before displaying the following error message:

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at TurbulenceService.AuthInfo.LoadUserFromDatabase(String tokenString) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\AuthInfo.cs:line 78
   at TurbulenceService.AuthInfo.VerifyToken(String tokenString, Int32 reqsize) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\AuthInfo.cs:line 49
   at TurbulenceService.TurbulenceService.GetVelocity(String authToken, String dataset, Single time, SpatialInterpolation spatialInterpolation, TemporalInterpolation temporalInterpolation, Point3[] points, String addr) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\WebSite\App_Code\WebService.cs:line 82
   --- End of inner exception stack trace ---"

Thank you for any help!