myndzi / pool2

38 stars 8 forks source link

TypeError: this._ping is not a function #29

Open pasupulaphani opened 8 years ago

pasupulaphani commented 8 years ago

Hi all,

Occasionally we are facing this error:

: /app/node_modules/newrelic/lib/transaction/tracer/index.js:169
:       throw err
: TypeError: this._ping is not a function
:       ^
:     at Pool._maybeAllocateResource (/app/node_modules/pool2/lib/pool.js:404:18)
:     at Immediate.wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:161:28)
:
:     at processImmediate [as _immediateCallback] (timers.js:529:5)
:     at tryOnImmediate (timers.js:550:5)
:     at runCallback (timers.js:570:20)

Our Knex version: 0.10.0 Pool2 version: "1.3.4"

Any thoughts?

myndzi commented 8 years ago

Seems like possibly a problem with newrelic? 'this._ping is not a function' could result from 'this' being incorrect; is there any way you can check that 'this' is correct in the context where this error occurs? (Maybe edit line 404 of pool.js to verify that 'this' looks like a Pool object)

Alternately, the property may have been changed or incorrectly specified, though it should be validated as a function, so it shouldn't be possible to initialize it as a non-function in the constructor options:

https://github.com/myndzi/pool2/blob/master/lib/pool.js#L81

lvffilho commented 8 years ago

Hi. Im having the same problem but with acquire method. It seems to be that this isnt Pool reference. Inspecting the code i saw that this is a 'window' reference. Im using knex with cordova

myndzi commented 8 years ago

Can you get a stack trace to see where the function is being called from?