Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@spirsch
Copy link
Collaborator

@spirsch spirsch commented Jun 8, 2022

This PR primarily adds the ability to track occupied host slots via named POSIX semaphores over multiple homcc calls and therefore limit the amount of locally running compilations as well as prohibiting to try compiling on remotehosts for which we already occupy all slots:

  • Host parsing is now done earlier due to needing to add a DEFAULT_LOCALHOST if no localhost host is explicitly provided.
  • [Remote/Localhost]HostSemaphore were added for their respective remote and local compilation cases via the posix_ipc library:
    • Signal handling for SIGINT and SIGTERM is provided via the HostSemaphore base class (SIGKILL cannot be handled explicitly and will lead to unwanted behavior)
    • RemoteHostSemaphore provides non blocking acquisition of the relevant semaphore
    • LocalHostSemaphore provides blocking acquisition of the relevant semaphore:
      In order to keep the order of compilation executions relatively similar to the order of when homcc processes were called, we currently use an "inverse exponential backoff" strategy where compilation requests wait longer in the beginning but decrease exponentially as briefly illustrated here.
  • The StateFile class adds the basic functionality for for managing distcc-monitoring tools compatible state files.

Additional Changes:

  • Overhaul of READE.md
  • Extended and refactored the Host class slightly and improved Host parsing which was partially necessary for the above mentioned semaphore creation and should improve clarity of tests

@spirsch spirsch requested review from k-lukas and wmann-celonis June 8, 2022 10:07
@spirsch spirsch marked this pull request as ready for review June 8, 2022 10:07
@spirsch spirsch merged commit 9ff87f7 into main Jun 23, 2022
@spirsch spirsch deleted the CPL-6548-Stateful-Host-Slots branch June 23, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants