Opened 15 years ago
Closed 15 years ago
#6595 closed defect (fixed)
Slave backend not reconnecting on socket loss, QTimer/threads related
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | critical | Milestone: | 0.22 |
Component: | MythTV - General | Version: | head |
Severity: | high | Keywords: | win32 qtimer |
Cc: | Ticket locked: | no |
Description
Running trunk r20649, Qt4.4.3:
When my slave backend loses its connection to the master backend, the slave console shows "QObject::startTimer: timers cannot be started from another thread" and the slave never tries to reconnect.
The relevant threads appear to be MainServer? and MythSocketThread?. When the socket closes, MythSocketThread? calls a member function in MainServer? that tries to start the masterServerReconnect Qtimer.
But apparently Qt enforces the Qtimer/thread relationship differently on win32 vs. linux (both Qt4.4.3). On linux, the existing code works - timer is started and the slave reconnects. On win32, the error prints, and the timer does not start.
The attached patch corrects this issue on win32 by emitting a signal instead of starting the timer. I've seen other cases of similar Qtimer/thread errors on win32, so I'd be interested in knowing if there are other/better ways to fix this.
Attachments (2)
Change History (7)
Changed 15 years ago by
Attachment: | 6595-mainserver-qtimer.patch added |
---|
comment:1 Changed 15 years ago by
Milestone: | unknown → 0.22 |
---|---|
Priority: | minor → critical |
Severity: | medium → high |
comment:2 Changed 15 years ago by
Owner: | changed from Isaac Richards to danielk |
---|---|
Status: | new → assigned |
comment:3 follow-up: 4 Changed 15 years ago by
Status: | assigned → infoneeded |
---|
Jeff, can you test the attached patch and let me know if this solves the problem as well?
comment:4 Changed 15 years ago by
Replying to danielk:
Jeff, can you test the attached patch and let me know if this solves the problem as well?
Yes, the patch does fix this problem. Thanks!
comment:5 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | infoneeded → closed |
I don't like the patch, but this problem needs to be addressed before the 0.22 release.