aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-13 16:49:10 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-13 16:49:10 -0500
commit0ec21e2525feebe2fcd96fe5e0e3bc113ae3340e (patch)
treedb146fd888a8308848529172f9cba6cb475b9150
parent594fc55d17f6e2b912cefec56a0217990673c04c (diff)
server pdf stability improvements
-rw-r--r--solr-8.3.1/server/logs/solr.log4
-rw-r--r--solr-8.3.1/server/logs/solr_gc.log.0.current166
-rw-r--r--src/client/views/pdf/PDFViewer.tsx9
-rw-r--r--src/server/ApiManagers/PDFManager.ts37
4 files changed, 196 insertions, 20 deletions
diff --git a/solr-8.3.1/server/logs/solr.log b/solr-8.3.1/server/logs/solr.log
index 25c8bae75..10ed06cb3 100644
--- a/solr-8.3.1/server/logs/solr.log
+++ b/solr-8.3.1/server/logs/solr.log
@@ -31,3 +31,7 @@
2019-12-13 19:19:30.793 INFO (main) [ ] o.e.j.s.AbstractConnector Started ServerConnector@8297b3a{HTTP/1.1,[http/1.1, h2c]}{0.0.0.0:8983}
2019-12-13 19:19:30.793 INFO (main) [ ] o.e.j.s.Server Started @4641ms
2019-12-13 19:19:31.371 INFO (qtp1664439369-23) [ ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/info/system params={wt=json} status=0 QTime=51
+2019-12-13 20:58:25.058 INFO (qtp1664439369-19) [ ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/info/system params={wt=json} status=0 QTime=42
+2019-12-13 20:58:36.863 INFO (qtp1664439369-22) [ ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/cores params={indexInfo=false&wt=json&_=1576270716757} status=0 QTime=6
+2019-12-13 20:58:36.894 INFO (qtp1664439369-18) [ ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/info/system params={wt=json&_=1576270716757} status=0 QTime=36
+2019-12-13 20:58:36.921 INFO (qtp1664439369-40) [ ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/info/system params={wt=json&_=1576270716757} status=0 QTime=24
diff --git a/solr-8.3.1/server/logs/solr_gc.log.0.current b/solr-8.3.1/server/logs/solr_gc.log.0.current
index e45ebc49d..687372454 100644
--- a/solr-8.3.1/server/logs/solr_gc.log.0.current
+++ b/solr-8.3.1/server/logs/solr_gc.log.0.current
@@ -322,4 +322,168 @@ Heap after GC invocations=4 (full 0):
2019-12-13T14:28:30.983-0500: 544.810: Total time for which application threads were stopped: 0.0000737 seconds, Stopping threads took: 0.0000252 seconds
2019-12-13T14:29:31.010-0500: 604.836: Total time for which application threads were stopped: 0.0000722 seconds, Stopping threads took: 0.0000242 seconds
2019-12-13T14:30:31.042-0500: 664.865: Total time for which application threads were stopped: 0.0000756 seconds, Stopping threads took: 0.0000251 seconds
-2019-12-13T14:31:31.0 \ No newline at end of file
+2019-12-13T14:31:31.081-0500: 724.901: Total time for which application threads were stopped: 0.0002465 seconds, Stopping threads took: 0.0001502 seconds
+2019-12-13T14:36:31.227-0500: 1025.037: Total time for which application threads were stopped: 0.0000861 seconds, Stopping threads took: 0.0000258 seconds
+2019-12-13T14:36:55.239-0500: 1049.048: Total time for which application threads were stopped: 0.0000796 seconds, Stopping threads took: 0.0000297 seconds
+2019-12-13T14:37:31.260-0500: 1085.068: Total time for which application threads were stopped: 0.0000800 seconds, Stopping threads took: 0.0000252 seconds
+2019-12-13T14:39:31.321-0500: 1205.125: Total time for which application threads were stopped: 0.0000985 seconds, Stopping threads took: 0.0000317 seconds
+2019-12-13T14:41:31.380-0500: 1325.180: Total time for which application threads were stopped: 0.0000677 seconds, Stopping threads took: 0.0000185 seconds
+2019-12-13T14:42:31.415-0500: 1385.213: Total time for which application threads were stopped: 0.0000780 seconds, Stopping threads took: 0.0000247 seconds
+2019-12-13T14:43:31.443-0500: 1445.239: Total time for which application threads were stopped: 0.0000742 seconds, Stopping threads took: 0.0000250 seconds
+2019-12-13T14:44:31.467-0500: 1505.261: Total time for which application threads were stopped: 0.0000927 seconds, Stopping threads took: 0.0000250 seconds
+2019-12-13T14:45:31.500-0500: 1565.292: Total time for which application threads were stopped: 0.0000861 seconds, Stopping threads took: 0.0000298 seconds
+2019-12-13T14:46:31.532-0500: 1625.322: Total time for which application threads were stopped: 0.0000926 seconds, Stopping threads took: 0.0000288 seconds
+2019-12-13T14:51:31.682-0500: 1925.463: Total time for which application threads were stopped: 0.0000831 seconds, Stopping threads took: 0.0000269 seconds
+2019-12-13T14:52:29.711-0500: 1983.489: Total time for which application threads were stopped: 0.0000811 seconds, Stopping threads took: 0.0000264 seconds
+2019-12-13T14:57:30.858-0500: 2284.628: Total time for which application threads were stopped: 0.0000834 seconds, Stopping threads took: 0.0000264 seconds
+2019-12-13T15:17:31.465-0500: 3485.201: Total time for which application threads were stopped: 0.0001128 seconds, Stopping threads took: 0.0000462 seconds
+2019-12-13T15:19:31.533-0500: 3605.266: Total time for which application threads were stopped: 0.0000927 seconds, Stopping threads took: 0.0000303 seconds
+2019-12-13T15:23:31.655-0500: 3845.381: Total time for which application threads were stopped: 0.0000822 seconds, Stopping threads took: 0.0000273 seconds
+2019-12-13T15:40:32.169-0500: 4865.871: Total time for which application threads were stopped: 0.0000997 seconds, Stopping threads took: 0.0000339 seconds
+2019-12-13T15:41:32.197-0500: 4925.897: Total time for which application threads were stopped: 0.0000729 seconds, Stopping threads took: 0.0000235 seconds
+2019-12-13T15:47:32.371-0500: 5286.063: Total time for which application threads were stopped: 0.0001041 seconds, Stopping threads took: 0.0000327 seconds
+2019-12-13T15:51:32.487-0500: 5526.174: Total time for which application threads were stopped: 0.0000795 seconds, Stopping threads took: 0.0000253 seconds
+2019-12-13T15:55:15.598-0500: 5749.280: Total time for which application threads were stopped: 0.0001565 seconds, Stopping threads took: 0.0000314 seconds
+2019-12-13T15:56:32.638-0500: 5826.319: Total time for which application threads were stopped: 0.0000771 seconds, Stopping threads took: 0.0000240 seconds
+2019-12-13T15:58:09.684-0500: 5923.363: Total time for which application threads were stopped: 0.0000708 seconds, Stopping threads took: 0.0000216 seconds
+2019-12-13T15:58:25.054-0500: 5938.734: Total time for which application threads were stopped: 0.0003699 seconds, Stopping threads took: 0.0000196 seconds
+2019-12-13T15:58:25.054-0500: 5938.734: Total time for which application threads were stopped: 0.0000675 seconds, Stopping threads took: 0.0000113 seconds
+2019-12-13T15:58:25.054-0500: 5938.734: Total time for which application threads were stopped: 0.0000413 seconds, Stopping threads took: 0.0000101 seconds
+2019-12-13T15:58:26.056-0500: 5939.735: Total time for which application threads were stopped: 0.0001509 seconds, Stopping threads took: 0.0000193 seconds
+2019-12-13T15:58:35.718-0500: 5949.397: Total time for which application threads were stopped: 0.0001277 seconds, Stopping threads took: 0.0000247 seconds
+2019-12-13T15:58:35.719-0500: 5949.398: Total time for which application threads were stopped: 0.0000785 seconds, Stopping threads took: 0.0000151 seconds
+2019-12-13T15:58:35.762-0500: 5949.441: Total time for which application threads were stopped: 0.0000840 seconds, Stopping threads took: 0.0000249 seconds
+2019-12-13T15:58:35.762-0500: 5949.441: Total time for which application threads were stopped: 0.0000521 seconds, Stopping threads took: 0.0000146 seconds
+2019-12-13T15:58:35.762-0500: 5949.441: Total time for which application threads were stopped: 0.0000387 seconds, Stopping threads took: 0.0000131 seconds
+2019-12-13T15:58:35.790-0500: 5949.469: Total time for which application threads were stopped: 0.0000792 seconds, Stopping threads took: 0.0000227 seconds
+2019-12-13T15:58:35.825-0500: 5949.505: Total time for which application threads were stopped: 0.0018974 seconds, Stopping threads took: 0.0009431 seconds
+2019-12-13T15:58:35.845-0500: 5949.524: Total time for which application threads were stopped: 0.0038627 seconds, Stopping threads took: 0.0037713 seconds
+2019-12-13T15:58:35.845-0500: 5949.525: Total time for which application threads were stopped: 0.0003415 seconds, Stopping threads took: 0.0002770 seconds
+2019-12-13T15:58:35.856-0500: 5949.535: Total time for which application threads were stopped: 0.0001537 seconds, Stopping threads took: 0.0000599 seconds
+2019-12-13T15:58:35.856-0500: 5949.535: Total time for which application threads were stopped: 0.0001040 seconds, Stopping threads took: 0.0000346 seconds
+2019-12-13T15:58:35.861-0500: 5949.540: Total time for which application threads were stopped: 0.0001447 seconds, Stopping threads took: 0.0000367 seconds
+2019-12-13T15:58:35.871-0500: 5949.551: Total time for which application threads were stopped: 0.0001568 seconds, Stopping threads took: 0.0000513 seconds
+2019-12-13T15:58:35.876-0500: 5949.555: Total time for which application threads were stopped: 0.0002530 seconds, Stopping threads took: 0.0000532 seconds
+2019-12-13T15:58:35.885-0500: 5949.564: Total time for which application threads were stopped: 0.0015837 seconds, Stopping threads took: 0.0014686 seconds
+2019-12-13T15:58:35.897-0500: 5949.576: Total time for which application threads were stopped: 0.0001451 seconds, Stopping threads took: 0.0000412 seconds
+2019-12-13T15:58:35.897-0500: 5949.577: Total time for which application threads were stopped: 0.0001025 seconds, Stopping threads took: 0.0000230 seconds
+2019-12-13T15:58:35.897-0500: 5949.577: Total time for which application threads were stopped: 0.0000632 seconds, Stopping threads took: 0.0000166 seconds
+2019-12-13T15:58:35.897-0500: 5949.577: Total time for which application threads were stopped: 0.0000689 seconds, Stopping threads took: 0.0000172 seconds
+2019-12-13T15:58:35.897-0500: 5949.577: Total time for which application threads were stopped: 0.0000850 seconds, Stopping threads took: 0.0000176 seconds
+2019-12-13T15:58:35.898-0500: 5949.577: Total time for which application threads were stopped: 0.0001922 seconds, Stopping threads took: 0.0001196 seconds
+2019-12-13T15:58:35.898-0500: 5949.577: Total time for which application threads were stopped: 0.0000606 seconds, Stopping threads took: 0.0000168 seconds
+2019-12-13T15:58:35.898-0500: 5949.577: Total time for which application threads were stopped: 0.0000555 seconds, Stopping threads took: 0.0000159 seconds
+2019-12-13T15:58:35.898-0500: 5949.577: Total time for which application threads were stopped: 0.0000564 seconds, Stopping threads took: 0.0000160 seconds
+2019-12-13T15:58:35.898-0500: 5949.577: Total time for which application threads were stopped: 0.0000587 seconds, Stopping threads took: 0.0000161 seconds
+2019-12-13T15:58:35.927-0500: 5949.607: Total time for which application threads were stopped: 0.0001109 seconds, Stopping threads took: 0.0000534 seconds
+2019-12-13T15:58:36.856-0500: 5950.535: Total time for which application threads were stopped: 0.0001815 seconds, Stopping threads took: 0.0000219 seconds
+2019-12-13T15:58:37.856-0500: 5951.535: Total time for which application threads were stopped: 0.0000822 seconds, Stopping threads took: 0.0000206 seconds
+2019-12-13T15:58:46.860-0500: 5960.539: Total time for which application threads were stopped: 0.0000913 seconds, Stopping threads took: 0.0000300 seconds
+2019-12-13T15:58:59.867-0500: 5973.545: Total time for which application threads were stopped: 0.0000974 seconds, Stopping threads took: 0.0000263 seconds
+2019-12-13T15:59:31.882-0500: 6005.560: Total time for which application threads were stopped: 0.0001038 seconds, Stopping threads took: 0.0000309 seconds
+2019-12-13T16:00:35.912-0500: 6069.588: Total time for which application threads were stopped: 0.0000783 seconds, Stopping threads took: 0.0000223 seconds
+2019-12-13T16:02:55.980-0500: 6209.653: Total time for which application threads were stopped: 0.0000870 seconds, Stopping threads took: 0.0000270 seconds
+2019-12-13T16:07:01.094-0500: 6454.762: Total time for which application threads were stopped: 0.0001021 seconds, Stopping threads took: 0.0000318 seconds
+2019-12-13T16:07:51.119-0500: 6504.786: Total time for which application threads were stopped: 0.0000833 seconds, Stopping threads took: 0.0000264 seconds
+2019-12-13T16:09:42.175-0500: 6615.841: Total time for which application threads were stopped: 0.0001578 seconds, Stopping threads took: 0.0001029 seconds
+2019-12-13T16:09:47.178-0500: 6620.843: Total time for which application threads were stopped: 0.0000833 seconds, Stopping threads took: 0.0000343 seconds
+2019-12-13T16:09:52.181-0500: 6625.847: Total time for which application threads were stopped: 0.0000839 seconds, Stopping threads took: 0.0000264 seconds
+2019-12-13T16:09:54.183-0500: 6627.848: Total time for which application threads were stopped: 0.0000903 seconds, Stopping threads took: 0.0000231 seconds
+2019-12-13T16:09:55.183-0500: 6628.848: Total time for which application threads were stopped: 0.0000877 seconds, Stopping threads took: 0.0000241 seconds
+2019-12-13T16:09:56.184-0500: 6629.849: Total time for which application threads were stopped: 0.0001001 seconds, Stopping threads took: 0.0000234 seconds
+2019-12-13T16:10:02.186-0500: 6635.851: Total time for which application threads were stopped: 0.0000840 seconds, Stopping threads took: 0.0000265 seconds
+2019-12-13T16:10:04.187-0500: 6637.852: Total time for which application threads were stopped: 0.0001204 seconds, Stopping threads took: 0.0000261 seconds
+2019-12-13T16:10:21.197-0500: 6654.861: Total time for which application threads were stopped: 0.0000971 seconds, Stopping threads took: 0.0000267 seconds
+2019-12-13T16:10:22.197-0500: 6655.862: Total time for which application threads were stopped: 0.0000808 seconds, Stopping threads took: 0.0000242 seconds
+2019-12-13T16:10:23.198-0500: 6656.862: Total time for which application threads were stopped: 0.0000840 seconds, Stopping threads took: 0.0000238 seconds
+2019-12-13T16:10:24.198-0500: 6657.863: Total time for which application threads were stopped: 0.0000868 seconds, Stopping threads took: 0.0000266 seconds
+2019-12-13T16:10:25.199-0500: 6658.864: Total time for which application threads were stopped: 0.0000835 seconds, Stopping threads took: 0.0000269 seconds
+2019-12-13T16:12:13.248-0500: 6766.911: Total time for which application threads were stopped: 0.0001228 seconds, Stopping threads took: 0.0000299 seconds
+2019-12-13T16:12:56.273-0500: 6809.935: Total time for which application threads were stopped: 0.0001019 seconds, Stopping threads took: 0.0000298 seconds
+2019-12-13T16:13:04.277-0500: 6817.939: Total time for which application threads were stopped: 0.0000859 seconds, Stopping threads took: 0.0000274 seconds
+2019-12-13T16:14:31.319-0500: 6904.979: Total time for which application threads were stopped: 0.0001123 seconds, Stopping threads took: 0.0000309 seconds
+2019-12-13T16:14:32.319-0500: 6905.979: Total time for which application threads were stopped: 0.0001097 seconds, Stopping threads took: 0.0000280 seconds
+2019-12-13T16:16:32.379-0500: 7026.037: Total time for which application threads were stopped: 0.0000783 seconds, Stopping threads took: 0.0000233 seconds
+2019-12-13T16:17:31.409-0500: 7085.066: Total time for which application threads were stopped: 0.0000940 seconds, Stopping threads took: 0.0000354 seconds
+2019-12-13T16:18:36.447-0500: 7150.103: Total time for which application threads were stopped: 0.0000948 seconds, Stopping threads took: 0.0000364 seconds
+2019-12-13T16:19:01.459-0500: 7175.114: Total time for which application threads were stopped: 0.0000938 seconds, Stopping threads took: 0.0000270 seconds
+2019-12-13T16:19:31.474-0500: 7205.129: Total time for which application threads were stopped: 0.0000943 seconds, Stopping threads took: 0.0000283 seconds
+2019-12-13T16:19:32.474-0500: 7206.129: Total time for which application threads were stopped: 0.0000866 seconds, Stopping threads took: 0.0000244 seconds
+2019-12-13T16:21:26.529-0500: 7320.182: Total time for which application threads were stopped: 0.0000850 seconds, Stopping threads took: 0.0000263 seconds
+2019-12-13T16:21:32.532-0500: 7326.184: Total time for which application threads were stopped: 0.0000867 seconds, Stopping threads took: 0.0000260 seconds
+2019-12-13T16:22:32.557-0500: 7386.209: Total time for which application threads were stopped: 0.0000828 seconds, Stopping threads took: 0.0000258 seconds
+2019-12-13T16:23:09.578-0500: 7423.228: Total time for which application threads were stopped: 0.0000867 seconds, Stopping threads took: 0.0000266 seconds
+2019-12-13T16:23:12.579-0500: 7426.230: Total time for which application threads were stopped: 0.0000878 seconds, Stopping threads took: 0.0000262 seconds
+2019-12-13T16:23:13.579-0500: 7427.230: Total time for which application threads were stopped: 0.0001116 seconds, Stopping threads took: 0.0000279 seconds
+2019-12-13T16:23:14.580-0500: 7428.231: Total time for which application threads were stopped: 0.0000861 seconds, Stopping threads took: 0.0000273 seconds
+2019-12-13T16:23:18.581-0500: 7432.232: Total time for which application threads were stopped: 0.0000899 seconds, Stopping threads took: 0.0000285 seconds
+2019-12-13T16:23:31.589-0500: 7445.240: Total time for which application threads were stopped: 0.0000942 seconds, Stopping threads took: 0.0000286 seconds
+2019-12-13T16:23:39.593-0500: 7453.243: Total time for which application threads were stopped: 0.0001319 seconds, Stopping threads took: 0.0000374 seconds
+2019-12-13T16:23:41.594-0500: 7455.244: Total time for which application threads were stopped: 0.0000986 seconds, Stopping threads took: 0.0000269 seconds
+2019-12-13T16:23:44.596-0500: 7458.246: Total time for which application threads were stopped: 0.0000753 seconds, Stopping threads took: 0.0000196 seconds
+2019-12-13T16:23:45.597-0500: 7459.247: Total time for which application threads were stopped: 0.0000923 seconds, Stopping threads took: 0.0000269 seconds
+2019-12-13T16:23:50.598-0500: 7464.248: Total time for which application threads were stopped: 0.0000901 seconds, Stopping threads took: 0.0000260 seconds
+2019-12-13T16:24:02.603-0500: 7476.253: Total time for which application threads were stopped: 0.0000879 seconds, Stopping threads took: 0.0000266 seconds
+2019-12-13T16:24:03.603-0500: 7477.253: Total time for which application threads were stopped: 0.0000809 seconds, Stopping threads took: 0.0000256 seconds
+2019-12-13T16:24:05.604-0500: 7479.254: Total time for which application threads were stopped: 0.0000870 seconds, Stopping threads took: 0.0000265 seconds
+2019-12-13T16:24:07.605-0500: 7481.255: Total time for which application threads were stopped: 0.0000906 seconds, Stopping threads took: 0.0000275 seconds
+2019-12-13T16:24:09.606-0500: 7483.256: Total time for which application threads were stopped: 0.0000833 seconds, Stopping threads took: 0.0000252 seconds
+2019-12-13T16:24:10.606-0500: 7484.256: Total time for which application threads were stopped: 0.0000848 seconds, Stopping threads took: 0.0000252 seconds
+2019-12-13T16:24:11.606-0500: 7485.256: Total time for which application threads were stopped: 0.0000895 seconds, Stopping threads took: 0.0000260 seconds
+2019-12-13T16:24:12.607-0500: 7486.257: Total time for which application threads were stopped: 0.0000837 seconds, Stopping threads took: 0.0000257 seconds
+2019-12-13T16:24:14.608-0500: 7488.258: Total time for which application threads were stopped: 0.0000851 seconds, Stopping threads took: 0.0000265 seconds
+2019-12-13T16:24:16.609-0500: 7490.259: Total time for which application threads were stopped: 0.0000911 seconds, Stopping threads took: 0.0000254 seconds
+2019-12-13T16:24:24.612-0500: 7498.261: Total time for which application threads were stopped: 0.0001183 seconds, Stopping threads took: 0.0000294 seconds
+2019-12-13T16:24:25.612-0500: 7499.262: Total time for which application threads were stopped: 0.0002358 seconds, Stopping threads took: 0.0001474 seconds
+2019-12-13T16:24:50.625-0500: 7524.274: Total time for which application threads were stopped: 0.0000804 seconds, Stopping threads took: 0.0000241 seconds
+2019-12-13T16:30:42.805-0500: 7876.448: Total time for which application threads were stopped: 0.0002015 seconds, Stopping threads took: 0.0000382 seconds
+2019-12-13T16:36:07.971-0500: 8201.609: Total time for which application threads were stopped: 0.0001098 seconds, Stopping threads took: 0.0000310 seconds
+2019-12-13T16:36:16.975-0500: 8210.612: Total time for which application threads were stopped: 0.0000827 seconds, Stopping threads took: 0.0000270 seconds
+2019-12-13T16:36:31.982-0500: 8225.619: Total time for which application threads were stopped: 0.0000675 seconds, Stopping threads took: 0.0000229 seconds
+2019-12-13T16:36:32.982-0500: 8226.620: Total time for which application threads were stopped: 0.0000745 seconds, Stopping threads took: 0.0000217 seconds
+2019-12-13T16:44:33.635-0500: 8707.266: Total time for which application threads were stopped: 0.0007029 seconds, Stopping threads took: 0.0003845 seconds
+2019-12-13T16:44:34.637-0500: 8708.267: Total time for which application threads were stopped: 0.0001147 seconds, Stopping threads took: 0.0000310 seconds
+2019-12-13T16:45:15.662-0500: 8749.291: Total time for which application threads were stopped: 0.0001041 seconds, Stopping threads took: 0.0000289 seconds
+2019-12-13T16:45:26.667-0500: 8760.296: Total time for which application threads were stopped: 0.0001035 seconds, Stopping threads took: 0.0000324 seconds
+{Heap before GC invocations=5 (full 0):
+ garbage-first heap total 524288K, used 330659K [0x00000000e0000000, 0x00000000e0101000, 0x0000000100000000)
+ region size 1024K, 307 young (314368K), 4 survivors (4096K)
+ Metaspace used 32005K, capacity 33082K, committed 33408K, reserved 1079296K
+ class space used 3875K, capacity 4129K, committed 4224K, reserved 1048576K
+2019-12-13T16:45:41.460-0500: 8775.090: [GC pause (G1 Evacuation Pause) (young)
+Desired survivor size 20447232 bytes, new threshold 15 (max 15)
+- age 1: 394704 bytes, 394704 total
+- age 2: 1186424 bytes, 1581128 total
+, 0.1129248 secs]
+ [Parallel Time: 99.7 ms, GC Workers: 8]
+ [GC Worker Start (ms): Min: 8775094.0, Avg: 8775094.9, Max: 8775095.4, Diff: 1.5]
+ [Ext Root Scanning (ms): Min: 1.3, Avg: 12.0, Max: 70.9, Diff: 69.6, Sum: 95.9]
+ [Update RS (ms): Min: 0.0, Avg: 5.9, Max: 14.2, Diff: 14.2, Sum: 47.5]
+ [Processed Buffers: Min: 0, Avg: 3.6, Max: 10, Diff: 10, Sum: 29]
+ [Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
+ [Code Root Scanning (ms): Min: 0.0, Avg: 0.9, Max: 2.1, Diff: 2.1, Sum: 6.9]
+ [Object Copy (ms): Min: 12.1, Avg: 58.2, Max: 74.6, Diff: 62.6, Sum: 465.7]
+ [Termination (ms): Min: 15.1, Avg: 21.2, Max: 25.9, Diff: 10.8, Sum: 170.0]
+ [Termination Attempts: Min: 145, Avg: 171.0, Max: 187, Diff: 42, Sum: 1368]
+ [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
+ [GC Worker Total (ms): Min: 97.8, Avg: 98.3, Max: 99.2, Diff: 1.5, Sum: 786.5]
+ [GC Worker End (ms): Min: 8775193.2, Avg: 8775193.2, Max: 8775193.2, Diff: 0.0]
+ [Code Root Fixup: 0.4 ms]
+ [Code Root Purge: 0.8 ms]
+ [Clear CT: 0.5 ms]
+ [Other: 11.6 ms]
+ [Choose CSet: 0.0 ms]
+ [Ref Proc: 6.1 ms]
+ [Ref Enq: 0.1 ms]
+ [Redirty Cards: 0.2 ms]
+ [Humongous Register: 0.6 ms]
+ [Humongous Reclaim: 0.0 ms]
+ [Free CSet: 0.8 ms]
+ [Eden: 303.0M(303.0M)->0.0B(289.0M) Survivors: 4096.0K->18.0M Heap: 322.9M(512.0M)->33.2M(512.0M)]
+Heap after GC invocations=6 (full 0):
+ garbage-first heap total 524288K, used 34032K [0x00000000e0000000, 0x00000000e0101000, 0x0000000100000000)
+ region size 1024K, 18 young (18432K), 18 survivors (18432K)
+ Metaspace used 32005K, capacity 33082K, committed 33408K, reserved 1079296K
+ class space used 3875K, capacity 4129K, committed 4224K, reserved 1048576K
+}
+ [Times: user=0.20 sys=0.20, real=0.11 secs]
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 41825cda7..450add208 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -136,16 +136,18 @@ export class PDFViewer extends DocAnnotatableComponent<IViewerProps, PdfDocument
if (matches !== null) {
const properPath = Utils.prepend(`/files/pdfs/${matches[0]}`);
console.log(properPath);
- console.log(`The two (url and proper path) ${url === properPath ? "were" : "were not equal"}`);
if (!properPath.includes(url)) {
+ console.log(`The two (url and proper path) were not equal`);
const proto = Doc.GetProto(Document);
proto[this.props.fieldKey] = new PdfField(properPath);
proto[backup] = url;
+ } else {
+ console.log(`The two (url and proper path) were equal`);
}
} else {
console.log("Outer matches was null!");
}
- const path = Utils.prepend(`/files/pdf_thumbnails${this.props.url.substring("files/pdfs/".length, this.props.url.length - ".pdf".length)}-${(this.Document.curPage || 1)}.png`);
+ const path = Utils.prepend(`/thumbnail${this.props.url.substring("files/pdfs/".length, this.props.url.length - ".pdf".length)}-${(this.Document.curPage || 1)}.png`);
this._coverPath = JSON.parse(await rp.get(path));
runInAction(() => this._showWaiting = this._showCover = true);
this.props.startupLive && this.setupPdfJsViewer();
@@ -623,7 +625,8 @@ export class PDFViewer extends DocAnnotatableComponent<IViewerProps, PdfDocument
}
const nativeWidth = (this.Document.nativeWidth || 0);
const nativeHeight = (this.Document.nativeHeight || 0);
- return <img key={this._coverPath.path} src={this._coverPath.path} onError={action(() => this._coverPath.path = "http://www.cs.brown.edu/~bcz/face.gif")} onLoad={action(() => this._showWaiting = false)}
+ const resolved = Utils.prepend(this._coverPath.path);
+ return <img key={resolved} src={resolved} onError={action(() => this._coverPath.path = "http://www.cs.brown.edu/~bcz/face.gif")} onLoad={action(() => this._showWaiting = false)}
style={{ position: "absolute", display: "inline-block", top: 0, left: 0, width: `${nativeWidth}px`, height: `${nativeHeight}px` }} />;
}
diff --git a/src/server/ApiManagers/PDFManager.ts b/src/server/ApiManagers/PDFManager.ts
index a190ab0cb..30fadfebd 100644
--- a/src/server/ApiManagers/PDFManager.ts
+++ b/src/server/ApiManagers/PDFManager.ts
@@ -24,6 +24,14 @@ export default class PDFManager extends ApiManager {
}
+function dispatchThumbnail(res: express.Response, { width, height }: Pdfjs.PDFPageViewport, thumbnailName: string) {
+ res.send({
+ path: clientPathToFile(Directory.pdf_thumbnails, thumbnailName),
+ width,
+ height
+ });
+}
+
function getOrCreateThumbnail(thumbnailName: string, res: express.Response) {
const noExtension = thumbnailName.substring(0, thumbnailName.length - ".png".length);
const pageString = noExtension.split('-')[1];
@@ -33,17 +41,13 @@ function getOrCreateThumbnail(thumbnailName: string, res: express.Response) {
exists(path, (exists: boolean) => {
if (exists) {
const existingThumbnail = createReadStream(path);
- imageSize(existingThumbnail, (err: any, { width, height }: any) => {
+ imageSize(existingThumbnail, (err: any, viewport: any) => {
if (err) {
console.log(red(`In PDF thumbnail response, unable to determine dimensions of ${thumbnailName}:`));
console.log(err);
return;
}
- res.send({
- path: clientPathToFile(Directory.pdf_thumbnails, thumbnailName),
- width,
- height
- });
+ dispatchThumbnail(res, viewport, thumbnailName);
});
} else {
const offset = thumbnailName.length - pageString.length - 5;
@@ -70,19 +74,20 @@ async function CreateThumbnail(file: string, pageNumber: number, res: express.Re
await page.render(renderContext).promise;
const pngStream = canvas.createPNGStream();
const filenames = path.basename(file).split(".");
- const pngFile = serverPathToFile(Directory.pdf_thumbnails, `${filenames[0]}-${pageNumber}.png`);
+ const thumbnailName = `${filenames[0]}-${pageNumber}.png`;
+ const pngFile = serverPathToFile(Directory.pdf_thumbnails, thumbnailName);
const out = createWriteStream(pngFile);
pngStream.pipe(out);
- out.on("finish", () => {
- res.send({
- path: pngFile,
- width: viewport.width,
- height: viewport.height
+ return new Promise<void>((resolve, reject) => {
+ out.on("finish", () => {
+ dispatchThumbnail(res, viewport, thumbnailName);
+ resolve();
+ });
+ out.on("error", error => {
+ console.log(red(`In PDF thumbnail creation, encountered the following error when piping ${pngFile}:`));
+ console.log(error);
+ reject();
});
- });
- out.on("error", error => {
- console.log(red(`In PDF thumbnail creation, encountered the following error when piping ${pngFile}:`));
- console.log(error);
});
}