Skip to content

Conversation

@taooceros
Copy link
Member

fix #598

@taooceros
Copy link
Member Author

@jjw24
Copy link
Member

jjw24 commented Jul 26, 2021

@taooceros could you let me know what's tested please

@taooceros
Copy link
Member Author

taooceros commented Jul 26, 2021

@taooceros could you let me know what's tested please

I have tested the scenario descripted in #598 (a very large json output). It works fine with very large json (1500000 items).

The change is really simple. I just add a memorystream layer to read the console output from the process allowing it to exit, which causes the hang (not a lot refactor as I say in #598 due to consideration of possible future change).

Probably a regular memorystream will be fine because we generally won't need to deal with that much item, but I just found the recycle one

@Garulf
Copy link
Member

Garulf commented Jul 26, 2021

Testing in a moment, thank you so much for looking into this!

@Garulf
Copy link
Member

Garulf commented Jul 26, 2021

@taooceros Works perfectly! All values are being returned and Flow Launcher no longer gets stuck in a loading state.

@taooceros
Copy link
Member Author

@taooceros Works perfectly! All values are being returned and Flow Launcher no longer gets stuck in a loading state.

Perfect! Thank you so much for reporting the bug!

@taooceros taooceros requested review from JohnTheGr8 and jjw24 July 26, 2021 05:58
@taooceros taooceros added this to the 1.8.1 milestone Jul 26, 2021
@taooceros taooceros added the bug Something isn't working label Jul 26, 2021
@Garulf
Copy link
Member

Garulf commented Jul 26, 2021

Not sure whats causing this error but it might be releated:

03:09:09.2594-04:00 - ERROR - JsonRPCPlugin.ExecuteAsync - Exception for filename <C:\Users\William\AppData\Local\Programs\Python\Python39\pythonw.exe> with argument <>
EXCEPTION OCCURS: System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at async Task System.IO.Stream.CopyToAsyncInternal(Stream destination, int bufferSize, CancellationToken cancellationToken)
   at async Task<Stream> Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) x 2 in C:/projects/flow-launcher/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs:line 288

Flow Launcher seems to work regardless

@taooceros
Copy link
Member Author

This exception shouldn't be logged. Weird. Will take a look later.

@jjw24 jjw24 modified the milestones: 1.8.1, 1.9.0 Jul 26, 2021
@jjw24
Copy link
Member

jjw24 commented Jul 27, 2021

@taooceros let me know when this is ready, assuming you are still looking into the log above.

@taooceros
Copy link
Member Author

@jjw24 Good to review. I add another manual process.kill() to kill the process once the token is expired.

@taooceros
Copy link
Member Author

Hold on, I found an issue, let me fix it.

@taooceros
Copy link
Member Author

Done

@jjw24 jjw24 enabled auto-merge July 27, 2021 09:02
@jjw24 jjw24 merged commit 2777795 into dev Jul 27, 2021
@jjw24 jjw24 deleted the FixJsonRPCBufferExceed branch July 27, 2021 09:10
@jjw24 jjw24 mentioned this pull request Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python plugin: Flow Launcher hangs on stream output larger than buffer

4 participants