ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
37 stars 4 forks source link

Jobs with large amount of data being re-triggered after completion #3244

Open 3pichaxz0r opened 7 months ago

3pichaxz0r commented 7 months ago

Version

4.2.15

Severity

High

Environment

msi

Steps to Reproduce

Trigger a script from a dashboard/app (unsure if it needs to be triggered from dashboard or app, this is just when I experienced it) and have app wait for job results. When job data returned is above 900mb - 1gb the data is not pulled from the job results and instead the script is triggered continuously

Expected behavior

Data returned from job is pulled

Actual behavior

Job repeatedly triggered until manually canceled even though previous job returned data

Additional Environment data

Windows Server 2019 Datacenter Edition (Build 17763) (64-bit) (Release ID 1809). Scripts and apps are running in Powershell Core 7.4.1 Currently using LiteDB, plan to migrate to SQLite before PSU version 5 is released.

Data being returned from script is an array of psobjects

Visuals

No response

adamdriscoll commented 7 months ago

I have to admit, I've never tried to return that kind of data back from a job. I have to imagine it's crushing the DB. What kind of data are you returning that is so large?

3pichaxz0r commented 7 months ago

Returning an array of powershell objects. Powershell objects contain compuiter name, and a bunch of booleans for if an application is installed on the computer in question. I originally had the table this data is displayed by rendering the columns to indicate true/false if an app was installed for a computer but this was very taxing and slow.

The computer names are coming from our RMM and its all computers for a specific client (selected in the dashboard/app) so this can range from 10 devices to over 1000+ devices.

Im open to any suggestions on optimizing this and I can post the script contents if you'd like. I currently have a work around for this bug by outputting the data returned to a mongodb collection rather than outputting in script results.