[GH-ISSUE #60] Hard lock during progress bar update with DEBUG mode on #43

Closed
opened 2026-02-27 20:05:08 +03:00 by kerem · 4 comments
Owner

Originally created by @tomballgithub on GitHub (Jan 29, 2026).
Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/60

Might be unrelated to DEBUG mode, but the first time I ran it I saw a hard lock after trying to Ctrl-C in Windows terminal.

Looks like the hang was during close_pbar after the clean_final: print statement

DEBUG makes a mess of the progress bar, but that's OK, it's DEBUG mode

Here's what was on the screen:

[DEBUG 17:58:37] [XXX] [WRAP-SEND] GET https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%22271291003
[DEBUG 17:58:40] [XXX] [close_pbar] ENTRY - thread_pbar is None: False
* Downloading Followers:  75%|████████████████████▏      | 143/191 [8.7 names/req, reqs=15, mins=1.6, remain=0.5]
[DEBUG 17:58:40] [XXX] [close_pbar] logger_instance found: True, type: FilteredWriter
[DEBUG 17:58:40] [XXX] [close_pbar] clean_final: * Downloading Followers: 74%|████████████████████░░░░░░░░| 143/191 [8.7 names/req, reqs=15, mins=1.6, remain=0.5]
Originally created by @tomballgithub on GitHub (Jan 29, 2026). Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/60 Might be unrelated to DEBUG mode, but the first time I ran it I saw a hard lock after trying to Ctrl-C in Windows terminal. Looks like the hang was during close_pbar after the clean_final: print statement DEBUG makes a mess of the progress bar, but that's OK, it's DEBUG mode Here's what was on the screen: ``` [DEBUG 17:58:37] [XXX] [WRAP-SEND] GET https://www.instagram.com/graphql/query?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%22271291003 [DEBUG 17:58:40] [XXX] [close_pbar] ENTRY - thread_pbar is None: False * Downloading Followers: 75%|████████████████████▏ | 143/191 [8.7 names/req, reqs=15, mins=1.6, remain=0.5] [DEBUG 17:58:40] [XXX] [close_pbar] logger_instance found: True, type: FilteredWriter [DEBUG 17:58:40] [XXX] [close_pbar] clean_final: * Downloading Followers: 74%|████████████████████░░░░░░░░| 143/191 [8.7 names/req, reqs=15, mins=1.6, remain=0.5] ```
kerem closed this issue 2026-02-27 20:05:08 +03:00
Author
Owner

@tomballgithub commented on GitHub (Jan 29, 2026):

I restarted and it hard locked at the same place. It had nothing to do with CTRL-C.
But it is hard locked and CTRL-C won't even break out

Story available:                        False

Bio:



Timestamp:                              Thu 29 Jan 2026, 00:05:51
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX']
[DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX']
* Followers (190) actual (190) loaded from file 'instagram_XXX_followers.json' (25 Jan 26  22:27)
* Followers number changed for user XXX from 190 to 191 (+1)
[DEBUG 18:05:51] [XXX] Writing CSV entry to XXX.csv: Type=Followers Count, Old=190, New=191
[DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX']
* Downloading Followers:  99%|██████████████████████████▊| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1][DEBUG 18:07:44] [XXX] [close_pbar] ENTRY - thread_pbar is None: False
* Downloading Followers:  99%|██████████████████████████▊| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1]
[DEBUG 18:07:44] [XXX] [close_pbar] logger_instance found: True, type: FilteredWriter
[DEBUG 18:07:44] [XXX] [close_pbar] clean_final: * Downloading Followers: 99%|███████████████████████████░| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1]

<!-- gh-comment-id:3815678673 --> @tomballgithub commented on GitHub (Jan 29, 2026): I restarted and it hard locked at the same place. It had nothing to do with CTRL-C. But it is hard locked and CTRL-C won't even break out ``` Story available: False Bio: Timestamp: Thu 29 Jan 2026, 00:05:51 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── [DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX'] [DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX'] * Followers (190) actual (190) loaded from file 'instagram_XXX_followers.json' (25 Jan 26 22:27) * Followers number changed for user XXX from 190 to 191 (+1) [DEBUG 18:05:51] [XXX] Writing CSV entry to XXX.csv: Type=Followers Count, Old=190, New=191 [DEBUG 18:05:51] [XXX] UI Data Update: targets=['XXX'] * Downloading Followers: 99%|██████████████████████████▊| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1][DEBUG 18:07:44] [XXX] [close_pbar] ENTRY - thread_pbar is None: False * Downloading Followers: 99%|██████████████████████████▊| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1] [DEBUG 18:07:44] [XXX] [close_pbar] logger_instance found: True, type: FilteredWriter [DEBUG 18:07:44] [XXX] [close_pbar] clean_final: * Downloading Followers: 99%|███████████████████████████░| 190/191 [9.4 names/req, reqs=19, mins=1.9, remain=0.1] ```
Author
Owner

@tomballgithub commented on GitHub (Jan 29, 2026):

I turned DEBUG off and the hang went away

<!-- gh-comment-id:3815713153 --> @tomballgithub commented on GitHub (Jan 29, 2026): I turned DEBUG off and the hang went away
Author
Owner

@misiektoja commented on GitHub (Jan 29, 2026):

Thanks. I forgot to change STDOUT_LOCK from threading.Lock() to threading.RLock() as it had already been done for HTTP_SERIAL_LOCK and PROGRESS_BAR_LOCK. Fixed in 3dc1fb1e.

<!-- gh-comment-id:3820421637 --> @misiektoja commented on GitHub (Jan 29, 2026): Thanks. I forgot to change STDOUT_LOCK from threading.Lock() to threading.RLock() as it had already been done for HTTP_SERIAL_LOCK and PROGRESS_BAR_LOCK. Fixed in 3dc1fb1e.
Author
Owner

@tomballgithub commented on GitHub (Jan 30, 2026):

Fixed

<!-- gh-comment-id:3821771808 --> @tomballgithub commented on GitHub (Jan 30, 2026): Fixed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/instagram_monitor#43
No description provided.