Using go-sitemap-generator changes behavior of entire program #86
Labels
enhancement
Proposed enhancements to current behavior
performance
Performance issues and improvements
Describe the bug
The package
ikeikeikeike/go-sitemap-generator
currently sets the value of GOMAXPROCs (to NumCPUs) every time you create a new sitemap.In newer versions v2 they let you pass through the value you want, but this doesn't make this behavior any less insane.
This will limit the number of OS threads that can execute Go code for the entire program, likely causing unexpected behavior.
It will also happen whenever you create a new sitemap; if you do this more than once, you will have to set it back to whatever you prefer each time.
Generally speaking, if you don't absolutely need to make changes, it's best to just leave the runtime alone.
It also performs other sorts of insane behavior like logging to the global logger, bypassing application level logging conventions and causing unexpected log messages that you can't easily turn off..
See: https://github.com/ikeikeikeike/go-sitemap-generator/blob/v1/stm/sitemap.go#L11
Please consider removing the go-sitemap-generator package as a dependency; I don't know if there's anything better out there, but this behavior is bizarre and a bit scary.
I'm trying to figure out why they did this and may file an issue upstream as well, but given that it's now baked into their API as of version 2 I don't know that it's worth trying to salvage the package. Probably best to avoid it entirely.
The text was updated successfully, but these errors were encountered: