Repository navigation
הדפסה: פריסת PDF אחת בכל התהליך, ומסך שנסגר אינו מתחיל פריסה - #6072
Merged
Merged
Conversation
כל מסך הדפסה הריץ פריסה מלאה של הספר ב-isolate משלו בלי הגבלה. בדוח של Otzaria#6061 רצו 8 פריסות במקביל, הזיכרון הגיע ל-9GB והממשק נתקע 246 שניות בהמתנה ל-IncreaseMutatorCount. עכשיו הפריסות עוברות בתור אחד לכל התהליך, ופריסה שמסך ההדפסה שלה נסגר לפני שהגיע תורה אינה מתחילה.
Y-PLONI
force-pushed
the
fix/print-layout-queue
branch
from
November 27, 2026 00:35
c4f4d32 to
555c406
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
הבעיה
בדוח של #6061 (0.9.98+99803, מחשב עם 3.8GB) יש סדרת תקיעות במסך ההדפסה ב-22/11, ואחת מהן נמשכה 246 שניות:
_renderBlocksToPdf←ShapedText.layout).IsolateGroup::IncreaseMutatorCount, כלומר לתור לרוץ בין יותר מדי isolates פעילים. זה אותו מנגנון של [תקיעה] התוכנה נתקעה (7 שניות) #6060.כל מסך הדפסה הריץ פריסה ב-isolate משלו, בלי הגבלה ברמת התהליך:
SerialLatestRunner). הדפסה וייצוא לא עוברים בתור הזה, וכך גם מסכים אחרים.התיקון
PrintLayoutQueue: תור אחד לכל התהליך, כך שבכל רגע רצה פריסה מלאה אחת לכל היותר._preview.isStopped) לפני שהגיע תורה לא מתחילה. במקומה נזרקPdfExportCancelledException, שהמסלולים הקיימים כבר מטפלים בו בשקט._renderBlocksToPdfמעביר ל-queue פונקציה מקומית ו-tear-off. closure שלוכד אתthisבאותו scope היה נשלח ל-isolate ונכשל ב-"object is unsendable".debugRasterIdleממתין גם לתור.מגבלות:
_rasterLock, השחרור של התור רץ ב-zone של מי שהתחיל את הפריסה. בדיקות widget שמשאירות פריסה פתוחה צריכות לנקז אותה דרךdebugRasterIdle.בדיקות
test/printing/print_layout_queue_test.dartבודק שלוש התנהגויות:flutter analyze lib/printing test/printing: נקי.flutter test test/printing/: עברו 405, נכשלו 11.printing_screen_export_profile_test.dart(10) וב-printing_screen_word_export_test.dart(1).PRs פתוחים חופפים
printing_screen.dart. הקובץ ממוזג נקי עם השינוי הזה. ה-PR עצמו מתנגש עם dev בקבצים אחרים.