-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Exporting rooms messages as file throws error on server side #29903
Conversation
…nto fix/error-exporting-channel
🦋 Changeset detectedLatest commit: 991dc0b The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the context of this so take it as a symbolic approve, but I've been finding this every now and then lol
Codecov Report
@@ Coverage Diff @@
## develop #29903 +/- ##
===========================================
- Coverage 51.19% 51.04% -0.15%
===========================================
Files 811 809 -2
Lines 15059 15158 +99
Branches 2750 2812 +62
===========================================
+ Hits 7709 7738 +29
- Misses 6940 6983 +43
- Partials 410 437 +27
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without autoclose the fd won't be closed even on an error, please close it manually there too.
i also don't know anything about this, so just a pure technical review
also, idk the reason seems a bit weird imo. the fd being treated here is a read source, how autoclose works, i don't see how the descriptor could be closed without actually reaching eof. on this path, only if write is reading past eof for some reason or multiple actions are reading from the same file. first is very very unlikely, and if second is the case, this pr won't fix the problem. or if the source just doesn't exist maybe im missing something? |
As a side note, if it's kinda "consitent" to reproduce, you may start to put some logs or debug statements to see what's going on with the descriptor. Generally you don't need to change the autoClose form for readStreams, which could mean after the stream is being piped is still trying to be used somewhere else, maybe a place without an await or smth. |
…nto fix/error-exporting-channel
…nto fix/error-exporting-channel
Hey @KevLehman and @debdutdeb guess I've found the real root cause of this issue now |
This PR currently has a merge conflict. Please resolve this and then re-add the |
closed by #30657 unfortunately I was not actually aware of this PR and fixed the same thing in the above PR.. 😬 |
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Enter a room and access the "Export Messages" option in the menu. Choose the "Export as file" method and pick a date period, then click on the "Export" button.
Currently, an error is thrown (not consistently, it doesn't happen in every attempt):
Error logs
This error shouldn't be thrown anymore with the changhes in this PR.
Further comments
This error is not consistent to reproduce, but it happens after garbage collection runs (see the warning in the first line of the error logs). What may be going on is that the file descriptor was being closed (since it was unused) before we created the read stream. By using the file path instead we can avoid such errors and skip the
open
step that doesn't look useful.TC-851