Closed barjin closed 1 year ago
Hmm sounds like I forgot to reset the session pool stats in here:
I guess there are different ways to go around this, I also think that purging the KeyValueStore
doesn't really work correctly - if I purge the storage manually (by changing onlyPurgeOnce
to false
), I get this error message:
Error: Could not find file at /home/jindrichbar/Desktop/apify/crawlee/storage/key_value_stores/default/SDK_SESSION_POOL_STATE.json
at KeyValueFileSystemEntry.get (/home/jindrichbar/Desktop/apify/crawlee/packages/memory-storage/dist/fs/key-value-store/fs.js:70:23)
which is probably caused by some mismatch between the in-memory KVS state and the on-disk files.
Either way, if you have a quick fix that solves this, I'm all ears :) You're saying to "reset the session pool stats" - how to do that? I don't really see a reset (or similar) method on the SessionPool
class.
We need to add such method, just like we have stats.resetStore
.
Which package is this bug report for? If unsure which one to select, leave blank
@crawlee/core
Issue description
Observe the
storage/key_value_stores/default/SDK_SESSION_POOL_STATE.json
. Subsequent crawler runs keep appending new lines to it, never purging this file.If run for long enough, it could possibly cause a memory leak (like in the case of #2031 ).
Code sample
No response
Package version
3.5.4
Node.js version
Node.js 16, 18, 20
Operating system
Linux Mint, amd64
Apify platform
I have tested this on the
next
releaseNo response
Other context
No response