Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout on the control comm target #1106

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

martinRenou
Copy link
Member

So that if we don't get a response in time, we fallback to the old implementation of fetching the widgets one by one.

References

Similar to what has been done in https://github.com/jupyter-widgets/ipywidgets/pull/3335/files. Once we reuse the base manager, we can get rid of this code in Voila.

Code changes

Add a timeout so that the Promise gets rejected if we didn't get a response on the control comm target in time.

This can happen with Notebook <=6.1, if the comm_open message is not allowed, the handler will simply ignore our request to open on the control comme target (see this), resulting in never getting a response/close on the front-end, and the promise gets stuck.

User-facing changes

None

Backwards-incompatible changes

None

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2022

Binder 👈 Launch a Binder on branch martinRenou/voila/add_timeout_control

@martinRenou martinRenou added the enhancement New feature or request label Mar 7, 2022
So that if we don't get a response in time, we fallback to the old
implementation of fetching the widgets
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2022

Benchmark report

The execution time (in milliseconds) are grouped by test file, test type and browser.
For each case, the following values are computed: min <- [1st quartile - median - 3rd quartile] -> max.

Results table
Test file voila-tree-classic.ipynb voila-tree-light.ipynb voila-tree-dark.ipynb voila-tree-miami.ipynb basics.ipynb bqplot.ipynb dashboard.ipynb gridspecLayout.ipynb interactive.ipynb ipympl.ipynb ipyvolume.ipynb multiple_widgets.ipynb query-strings.ipynb reveal.ipynb
Render
chromium
actual 74 <- [77 - 88 - 107] -> 163 124 <- [140 - 171 - 232] -> 410 65 <- [66 - 73 - 82] -> 110 64 <- [67 - 72 - 81] -> 101 2590 <- [2637 - 2773 - 2832] -> 4347 2386 <- [2439 - 2439 - 2577] -> 2958 2577 <- [2633 - 2678 - 2742] -> 2961 3237 <- [3301 - 3369 - 3605] -> 3807 1923 <- [1946 - 1948 - 1956] -> 2130 4254 <- [4431 - 4813 - 5364] -> 7171 9565 <- [9643 - 10122 - 10459] -> 10851 9744 <- [9810 - 9884 - 9943] -> 10230 1279 <- [1477 - 1505 - 1513] -> 1533 2426 <- [2449 - 2458 - 2498] -> 2685
expected 3379 <- [3442 - 3517 - 3701] -> 3876 2976 <- [3227 - 3321 - 3421] -> 3604 3608 <- [3623 - 3709 - 3793] -> 3825 4453 <- [4453 - 4523 - 4661] -> 4748 2559 <- [2655 - 2656 - 2660] -> 2674 3982 <- [4079 - 4213 - 4356] -> 4743 12183 <- [18509 - 19553 - 20811] -> 21515 15319 <- [15660 - 15796 - 15912] -> 16056 1517 <- [1920 - 1997 - 2103] -> 2113

❗ Test metadata have changed
--- /dev/fd/63	2022-03-07 09:15:29.977081089 +0000
+++ /dev/fd/62	2022-03-07 09:15:29.981081119 +0000
@@ -4,37 +4,37 @@
     "BENCHMARK_REFERENCE": "actual"
   },
   "browsers": {
-    "chromium": "97.0.4666.0"
+    "chromium": "94.0.4595.0"
   },
   "systemInformation": {
     "cpu": {
-      "brand": "Xeon® Platinum 8272CL",
+      "brand": "Xeon® E5-2673 v3",
       "cache": {
         "l1d": 65536,
         "l1i": 65536,
-        "l2": 2097152,
-        "l3": 36700160
+        "l2": 524288,
+        "l3": 31457280
       },
       "cores": 2,
       "family": "6",
-      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xsaves md_clear",
+      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt md_clear",
       "governor": "",
       "manufacturer": "Intel®",
-      "model": "85",
+      "model": "63",
       "physicalCores": 2,
       "processors": 1,
       "revision": "",
       "socket": "",
-      "speed": 2.6,
+      "speed": 2.4,
       "speedMax": null,
       "speedMin": null,
-      "stepping": "7",
+      "stepping": "2",
       "vendor": "GenuineIntel",
       "virtualization": false,
       "voltage": ""
     },
     "mem": {
-      "total": 7284850688
+      "total": 7291699200
     },
     "osInfo": {
       "arch": "x64",
@@ -42,11 +42,11 @@
       "codename": "Focal Fossa",
       "codepage": "UTF-8",
       "distro": "Ubuntu",
-      "kernel": "5.11.0-1028-azure",
+      "kernel": "5.8.0-1040-azure",
       "logofile": "ubuntu",
       "platform": "linux",
-      "release": "20.04.4 LTS",
-      "serial": "6fe698402f044602bf038833560abb94",
+      "release": "20.04.3 LTS",
+      "serial": "cfc067bfcb844f35865e279a1b0e66c5",
       "servicepack": "",
       "uefi": false
     }

@@ -238,6 +243,12 @@ export class WidgetManager extends JupyterLabManager {

// Send a states request msg
initComm.send({ method: 'request_states' }, {});

// Reject if we didn't get a response in time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add TODO here to remove this code in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to my comment?

Once we reuse the base manager, we can get rid of this code in Voila.

The entire method _build_models will be removed once jupyter-widgets/ipywidgets#3335 gets released.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying!

@trungleduc
Copy link
Member

Thanks @martinRenou!

@trungleduc trungleduc merged commit d2220dd into voila-dashboards:main Mar 7, 2022
@martinRenou martinRenou deleted the add_timeout_control branch March 7, 2022 14:18
@martinRenou
Copy link
Member Author

Thank you for reviewing and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants