Skip to content
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

Potential issue with Threads #498

Closed
doomspork opened this issue Nov 4, 2016 · 7 comments
Closed

Potential issue with Threads #498

doomspork opened this issue Nov 4, 2016 · 7 comments

Comments

@doomspork
Copy link

doomspork commented Nov 4, 2016

Howdy @randym! First and foremost, thanks for axlsx it's been a lifesaver on a recent project. That said, I come to you with an issue I've encountered that I'm hoping you may be able to shed some light on.

I'm using Sidekiq in my application to generate and send out many reports at once and in doing so I have noticed something peculiar. If I only generate a single report at a time they will open successfully, but if I try to generate many at once only the first will be valid and the remainder invalid.

I've been racking my brain for the last few days and finally decided to yank out the code, simplify the Excel files, and attempt to reproduce the issue in a separate project and thankfully I was able to do just that. All I've done was setup the generation of 6 different files: 2 with no threading, 2 with threading, and 2 with threading plus a sleep(5). The result? Without an adequate sleep in between the files are invalid!

Digging deeper I took the two generated files, threadwosleep0.xlsx and threadwosleep1.xlsx, changed their extension to *.zip and diff'd them. What I found is that all of the files created within the threaded group share the same sheet.xml.rel yet the r:id value within our sheet1.xml file changes.

Here we can see the change in sheet1.xml:
image

But sheet.xml.rel shows no change:
image

Here is the sample project:
https://github.com/doomspork/axlsx_issue

Any thoughts?

@doomspork
Copy link
Author

I noticed #477 today, I'll give that a try and see if it resolves the issue.

@doomspork
Copy link
Author

@randym I was able to use @marshall-lee's patch and confirm it resolved the issue above. I'd be happy to pick-up where he left off if there is no updates to the PR.

@randym
Copy link
Owner

randym commented Nov 9, 2016

@doomspork very happy to here that the patch works! May I ask you to put together an updated PR with specs I would very much like to see a solution in master.

@doomspork
Copy link
Author

@randym I can look into doing that this week

@trautwein
Copy link

@doomspork Did you have a chance to look into updating the PR, yet? Would be great to have a solution.

@doomspork
Copy link
Author

@trautwein I have not. Been quite busy with work and family affairs. Truth be told, I'm not even 100% sure the best way to test this. I still need to play around with it.

@randym
Copy link
Owner

randym commented Apr 1, 2017

Closing this issue and hope to integrate one of the thread safely patches out there prior to 3.0.0 release scheduled for this month.

@randym randym closed this as completed Apr 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants