server icon indicating copy to clipboard operation
server copied to clipboard

Housekeeping of PKG_XXXX files

Open allanbowe opened this issue 3 years ago • 3 comments

SASjs server appears to be missing a housekeeping process - a number of directories are being created in the /tmp folder that are not being removed, see:

image

Expanding one of these folders, there are numerous files:

image

Each of which contains a SAS program:

image

Perhaps it's in relation to the deployment process?

allanbowe avatar Jun 20 '22 20:06 allanbowe

Turns out it must be in relation to the web server - I deleted a bunch of the files and the web apps stopped working!

image

Perhaps the files can be given more meaninful names, and their presence documented in the developer notes on https://server.sasjs.io ?

allanbowe avatar Jun 20 '22 20:06 allanbowe

files in ./pkg-* are additional files required by our package and part of final executable. See: https://github.com/sasjs/server/blob/main/api/package.json#L30

Refs:

  • https://github.com/vercel/pkg/issues/1606#issuecomment-1112015226
  • https://stackoverflow.com/a/27049546/12118530

We cannot explicitly delete these folders,

  • other execution which are in-progress depend on these,
  • cannot identify which other in-progress execution is mapped to which folder,
  • and let these be auto delete by system ( via cronjob OR reboot )

saadjutt01 avatar Jul 19 '22 12:07 saadjutt01

I see. Not ideal - the number of /tmp directories it created for the client was substantial, over a short time period also.

Reboot isn't really an option for a shared environment, nor is cronjob (how can we know which files to remove).

Let's keep this issue open until we have the capacity / resource to assist the aforementioned project with a pull request.

allanbowe avatar Jul 19 '22 13:07 allanbowe