rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.51k stars 70 forks source link

v3: race condition (v2 unaffected) #279

Closed rusq closed 6 months ago

rusq commented 6 months ago

Describe the bug Channel file gets closed before the final thread is written.

To Reproduce

Expected behavior Channel file should be finalised only after all data is written to it.

Output If applicable, add output to help explain your problem.

^Crecord: 2024/03/28 19:39:33 downloader.go:136: download worker 0 terminated
record: 2024/03/28 19:39:33 downloader.go:136: download worker 1 terminated
record: 2024/03/28 19:39:33 downloader.go:136: download worker 2 terminated
record: 2024/03/28 19:39:33 downloader.go:136: download worker 3 terminated
record: 2024/03/28 19:39:33 network.go:133: WithRetry: Post "https://slack.com/api/users.list": context canceled (*url.Error) after 1 attempts
record: 2024/03/28 19:39:33 downloader.go:257: requests channel closed, waiting for all downloads to complete
record: 2024/03/28 19:39:33 downloader.go:259: wait complete:  no more files to download
2024/03/28 19:39:33 Error 006 (Application Error): controller error in subroutine conversations on stage worker: error streaming conversations: failed to process thread message id=1xxxxxxx.000000, thread_ts=1xxxxxxx.000000: file slackdump_20240328_193841/CCCCCCCC.json.gz exists and not empty
controller error in subroutine user on stage worker: error listing users: Post "https://slack.com/api/users.list": context canceled

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Seems that withRetry attempts to retry the unrecoverable auth_error

rusq commented 6 months ago

Resolved in c16592a36c8e4d8dd