Calling `update()` inside `Control.did_mount()` causes deadlock
See original GitHub issueSample code causing deadlock:
import flet
from flet import Container, Page, Text, UserControl
class MyControl(UserControl):
def build(self):
print("i am built")
self.c = Container()
self.c.bgcolor = "blue"
self.c.content = Text("hello there")
return self.c
def did_mount(self):
print("i am mounted")
self.resize_me()
def resize_me(self):
self.c.bgcolor = "red"
self.update()
def main(page: Page):
t = MyControl()
page.add(t)
print("i am added")
flet.app(target=main)
Solution:
Go through a list of added controls after update()
is finished and lock released and call did_mount()
for each added control.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Getting deadlock when execute UPDATE at same time
I'm load testing the application and get deadlock error. The scenario is inserting and updating database concurrently by 10 different users. I ...
Read more >Deadlock occurs when issuing SELECT and UPDATE ...
I'm using SQL Server 2019, but a deadlock occurs when there is a lot of access. The target SELECT statement refers to only...
Read more >Process getting deadlock while updating a table in parallel
We are calling an update statement from Abinitio to oracle DB. Statement is running in parallel(4) with default table values(INI_RANS=1, ...
Read more >Why am I getting a deadlock for a single UPDATE query?
Your statement modifies several rows. Each of these rows is locked when it is updated. It is well possible that a statement in...
Read more >A Simple Explanation of React.useEffect() - Dmitri Pavlutin
Especially useEffect() — the hook that manages side-effects in functional React ... 3.1 Component did mount; 3.2 Component did update.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, it’s possible now.
Ah I see
Thank you for clarifying