Cache results of detecting X and PulseAudio when starting environment

Bug #1855898 reported by Balint Reczey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wslu (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Disco
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Detecting X and PulseAudio takes some time when starting every shell even when it is unlikely that those servers go away between opening new shells.
 * The fix is reusing cached info when starting new shells.

[ Test Case ]

 * Start X server and PulseAudio server on Windows, the host WSL system
 * run:

rm -f $HOME/.cache/wslu/integration
unset DISPLAY
unset PULSE_SERVER
time . /etc/profile.d/wsl-integration.sh
echo $DISPLAY $PULSE_SERVER
cat $HOME/.cache/wslu/integration
time . /etc/profile.d/wsl-integration.sh

 * Ran all of that again with X server and PulseAudio server turned off

[Regression Potential]

 * Wrong implementation of caching logic may break auto detection or cache a wrong result. The test case ensures that auto detection is still working and also checks the cache content.

Discovered regressions:
LP: #1859509 wsl-integration.sh shows error when .cache/ can't be created
LP: #1869878 Space in username breaks wsl integration cache

Balint Reczey (rbalint)
description: updated
Balint Reczey (rbalint)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wslu - 2.3.2-0ubuntu4

---------------
wslu (2.3.2-0ubuntu4) focal; urgency=medium

  * debian/wsl-integration.sh: Set timeouts for X and PulseAudio detection.
    This fixes long startup time when detection fails after waiting for long.
    (LP: #1855520)
  * Cache results of detecting X and sound server in $HOME/.config/wsl/integration-cache.
    Reuse results when starting new shells in the same runnig WSL Ubuntu instance.
    (LP: #1855898)
  * debian/wsl-integration.sh: Use pactl stat instead of pactl info in detection.
    Pactl stat is slightly faster, ~0.3s vs. ~0.45s with pactl info when running
    on WSL1.

 -- Balint Reczey <email address hidden> Wed, 11 Dec 2019 15:45:09 +0100

Changed in wslu (Ubuntu):
status: New → Fix Released
Balint Reczey (rbalint)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted wslu into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wslu/2.3.2-0ubuntu2~19.10.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in wslu (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Changed in wslu (Ubuntu Disco):
status: New → Fix Committed
tags: added: verification-needed-disco
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Balint, or anyone else affected,

Accepted wslu into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wslu/2.3.2-0ubuntu2~19.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in wslu (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Balint, or anyone else affected,

Accepted wslu into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wslu/2.3.2-0ubuntu2~18.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Balint, or anyone else affected,

Accepted wslu into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wslu/2.3.2-0ubuntu2~16.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in wslu (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Balint Reczey (rbalint) wrote :

Verified with all versions with running servers.

description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

Verified with all versions without running servers.

tags: added: verification-done verification-done-bionic verification-done-disco verification-done-eoan verification-done-xenial
removed: verification-needed verification-needed-bionic verification-needed-disco verification-needed-eoan verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wslu - 2.3.2-0ubuntu2~19.10.3

---------------
wslu (2.3.2-0ubuntu2~19.10.3) eoan; urgency=medium

  * Detect X and PulseAudio in WSL2, too (LP: #1853343)
  * debian/wsl-integration.sh: Use type instead of which for faster execution.
    Also skip all detection steps when pactl and xvinfo are not installed.
  * debian/wsl-integration.sh: Set timeouts for X and PulseAudio detection.
    This fixes long startup time when detection fails after waiting for long.
    (LP: #1855520)
  * Cache results of detecting X and sound server in
    $HOME/.cache/wslu/integration. (LP: #1855898)
    Reuse results when starting new shells in the same running
    WSL Ubuntu instance.

 -- Balint Reczey <email address hidden> Wed, 11 Dec 2019 21:33:12 +0100

Changed in wslu (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for wslu has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wslu - 2.3.2-0ubuntu2~19.04.3

---------------
wslu (2.3.2-0ubuntu2~19.04.3) disco; urgency=medium

  * Detect X and PulseAudio in WSL2, too (LP: #1853343)
  * debian/wsl-integration.sh: Use type instead of which for faster execution.
    Also skip all detection steps when pactl and xvinfo are not installed.
  * debian/wsl-integration.sh: Set timeouts for X and PulseAudio detection.
    This fixes long startup time when detection fails after waiting for long.
    (LP: #1855520)
  * Cache results of detecting X and sound server in
    $HOME/.cache/wslu/integration. (LP: #1855898)
    Reuse results when starting new shells in the same running
    WSL Ubuntu instance.

 -- Balint Reczey <email address hidden> Wed, 11 Dec 2019 21:33:12 +0100

Changed in wslu (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wslu - 2.3.2-0ubuntu2~18.04.3

---------------
wslu (2.3.2-0ubuntu2~18.04.3) bionic; urgency=medium

  * Detect X and PulseAudio in WSL2, too (LP: #1853343)
  * debian/wsl-integration.sh: Use type instead of which for faster execution.
    Also skip all detection steps when pactl and xvinfo are not installed.
  * debian/wsl-integration.sh: Set timeouts for X and PulseAudio detection.
    This fixes long startup time when detection fails after waiting for long.
    (LP: #1855520)
  * Cache results of detecting X and sound server in
    $HOME/.cache/wslu/integration. (LP: #1855898)
    Reuse results when starting new shells in the same running
    WSL Ubuntu instance.

 -- Balint Reczey <email address hidden> Wed, 11 Dec 2019 21:33:12 +0100

Changed in wslu (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wslu - 2.3.2-0ubuntu2~16.04.3

---------------
wslu (2.3.2-0ubuntu2~16.04.3) xenial; urgency=medium

  * Detect X and PulseAudio in WSL2, too (LP: #1853343)
  * debian/wsl-integration.sh: Use type instead of which for faster execution.
    Also skip all detection steps when pactl and xvinfo are not installed.
  * debian/wsl-integration.sh: Set timeouts for X and PulseAudio detection.
    This fixes long startup time when detection fails after waiting for long.
    (LP: #1855520)
  * Cache results of detecting X and sound server in
    $HOME/.cache/wslu/integration. (LP: #1855898)
    Reuse results when starting new shells in the same running
    WSL Ubuntu instance.

 -- Balint Reczey <email address hidden> Wed, 11 Dec 2019 21:33:12 +0100

Changed in wslu (Ubuntu Xenial):
status: Fix Committed → Fix Released
Balint Reczey (rbalint)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.