Commit 55d0455
committed
uploader: fix rate limiting for logdir polling
Summary:
Recent refactorings to the RPC rate limiting had the unintended side
effect of removing rate limiting on logdir polling. This meant that
after all data had been read from the logdir, the uploader would
continue to poll it aggressively (thousands of times per second on my
machine), which is bad for disks and expensive on network file systems.
This commit adds a separate rate limiter for the logdir polling. We
don’t reuse the RPC rate limiter because that would force us to tick
twice on the same timer every cycle.
Fixes #3001.
Test Plan:
Run `bazel run //tensorboard -- dev upload --logdir /nope --verbosity 0`
(with any logdir path, but it’s easier when it’s empty), and note that
the “Starting an upload cycle” logs now progress at 0.2 per second
rather than 6000 per second. TODO: Unit tests.
wchargin-branch: uploader-rate-limit-polling
wchargin-source: 2036f1c749e0c2f4e6db2362257e1f3f3a4342f21 parent 5147a5e commit 55d0455
2 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| |||
98 | 107 | | |
99 | 108 | | |
100 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
147 | 162 | | |
148 | 163 | | |
149 | 164 | | |
| 165 | + | |
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
0 commit comments