Skip to content

Conversation

patrick96
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

The module has a poll timeout because it needs to periodically check if it is shutting down. Otherwise, it would be stuck polling and the bar couldn't shut down until the script produces a new line.

However, this causes the bar to wake up intermittently (currently ~40/s) due to the 25ms timeout.
Bumping this to 250ms still gives us timely shut downs and caps the number of wake ups to 4/s.

This is only a stop-gap solution, ideally the script runner is integrated into the main event loop and uses its polling handles which don't have to wake up to check for a shutdown.

Related Issues & Documents

Ref #1778
Ref #2337

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

The module has a poll timeout because it needs to periodically check if
it is shutting down. Otherwise, it would be stuck polling and the bar
couldn't shut down until the script produces a new line.

However, this causes the bar to wake up intermittently (currently
~40/s) due to the 25ms timeout.
Bumping this to 250ms still gives us timely shut downs and caps the
number of wake ups to 4/s.

This is only a stop-gap solution, ideally the script runner is
integrated into the main event loop and uses its polling handles which
don't have to wake up to check for a shutdown.

Ref polybar#1778
Ref polybar#2337
@codecov
Copy link

codecov bot commented Dec 11, 2022

Codecov Report

Merging #2879 (56eea9c) into master (d5498c8) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master    #2879   +/-   ##
=======================================
  Coverage   13.17%   13.17%           
=======================================
  Files         162      162           
  Lines       11509    11509           
=======================================
  Hits         1516     1516           
  Misses       9993     9993           
Flag Coverage Δ
unittests 13.17% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/adapters/script_runner.cpp 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@patrick96 patrick96 merged commit edf3738 into polybar:master Dec 11, 2022
@patrick96 patrick96 deleted the script-poll-timeout branch December 11, 2022 23:52
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

Successfully merging this pull request may close these issues.

1 participant