xthursdayx / yacreaderlibrary-server-docker

Docker image running a headless version of YACReaderLibraryServer 📦
https://hub.docker.com/r/xthursdayx/yacreaderlibrary-server-docker
GNU General Public License v3.0
56 stars 5 forks source link

[BUG] chown -R /comics is slow on networked filesystem #37

Closed thebearmayor closed 10 months ago

thebearmayor commented 11 months ago

The command chown -R abc:abc /config /defaults /app /comics in the startup script takes a long time when there are many files in /comics, and /comics is a mounted network filesystem. Additionally, something kills this command after 5 minutes, causing a restart loop


Expected Behavior

Container should start successfully.

Current Behavior

I am deploying this container using the TrueCharts chart on TrueNAS SCALE. /comics is an NFS mount to localhost, due to limitations in SCALE. There are ~10k files in /comics.

Today, I noticed the yacreaderlibraryserver app was not starting successfully. Shelling into the container, I found the chown process running for several minutes. strace showed it was chowning every file in /comics, even if the ownership was correct. Additionally, strace showed the process was killed after 5 minutes, and a new chown process was started.

After deleting some files in /comics, yacreaderlibraryserver started successfully.

Steps to Reproduce

  1. Create a comics directory with many files on a network drive.
  2. Start container with network drive mounted on /comics.
  3. Shell into container and observe that chown is running for several minutes.
  4. Observe that chown is killed after 5 minutes and YACReaderLibraryServer does not start.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

OS: TrueNAS SCALE CPU architecture: x86_64

Command used to create docker container (run/create/compose/screenshot)

Docker logs

Additional information

It might be faster to do find . -not \( -user abc -and -group abc \) -exec chown abc:abc {} +

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

xthursdayx commented 10 months ago

I've updated the init script - do you want to give the new release a try and see if it is running faster for you/not failing in the networked environment?

thebearmayor commented 10 months ago

Thank you for taking a look at this. I suppose it was more of a problem with Truenas SCALE than with NFS specifically. I'm no longer using Truenas SCALE, just running on Docker, and both versions are fast now. Hopefully this helps somebody in my old situation.

xthursdayx commented 10 months ago

Right on, it couldn't have hurt to speed up the chown operation anyway, so thanks for the suggestion!