Skip to content

multistage-diagram-tactile-svg-handler times out on some textbook diagrams #1186

@jeffbl

Description

@jeffbl

On this diagram, no textbook rendering appears. It seems that cohenSutherlandClip is getting stuck (log below). Looking at the code, there is a while True: loop that could fail to break. I'm not familiar with this algorithm or exactly how it is used, but it looks like the case for both endpoints of the line being outside of the bounding rectangle is not in place (see } else if (outcode0 & outcode1) { here. I don't know if this is causing an infinite loop, but it would explain the behavior we're seeing.

monarch-link-app-1                        | 2025-12-13T16:32:42.521596063Z DEBUG:root:Sending tactile response                                                                                                                                                
monarch-link-app-1                        | 2025-12-13T16:32:44.748491614Z [2025-12-13 16:32:44 +0000] [99660] [DEBUG] GET /display/766323                                                                                                                    
monarch-link-app-1                        | 2025-12-13T16:32:44.748654301Z DEBUG:root:Display request received                                                                                                                                                
monarch-link-app-1                        | 2025-12-13T16:32:44.751026773Z DEBUG:root:Sending tactile response                                                                                                                                                
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.087952755Z [2025-12-13 16:32:46 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:271019)                                                                                                             
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088509073Z [2025-12-13 16:32:46 +0000] [271019] [ERROR] Error handling request /handler                                                                                                       
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088523891Z Traceback (most recent call last):                                                                                                                                                 
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088526406Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 135, in handle                                                                                     
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088528560Z     self.handle_request(listener, req, client, addr)                                                                                                                               
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088530454Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 178, in handle_request                                                                             
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088532427Z     respiter = self.wsgi(environ, resp.start_response)                                                                                                                             
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088534251Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2552, in __call__                                                                                              
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088536175Z     return self.wsgi_app(environ, start_response)                                                                                                                                  
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088538078Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2529, in wsgi_app                                                                                              
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088539922Z     response = self.full_dispatch_request()                                                                                                                                        
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088541755Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request                                                                                 
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088543629Z     rv = self.dispatch_request()                                                                                                                                                   
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088545462Z   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request                                                                                      
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088547356Z     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)                                                                                                       
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088549189Z   File "/usr/src/app/tactile_svg.py", line 214, in handle                                                                                                                          
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088551043Z     arw_tgt = cohenSutherlandClip(tgt_cntr, src_cntr,                                                                                                                              
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088553026Z   File "/usr/src/app/tactile_svg.py", line 345, in cohenSutherlandClip                                                                                                             
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088562594Z     code2 = computeCode(x2, y2, lims)                                                                                                                                              
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088563777Z   File "/usr/src/app/tactile_svg.py", line 281, in computeCode                                                                                                                     
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088564949Z     def computeCode(x, y, lims):                                                                                                                                                   
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088566041Z   File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 203, in handle_abort                                                                               
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088567243Z     sys.exit(1)                                                                                                                                                                    
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088568355Z SystemExit: 1                                                                                                                                                                      
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.088627857Z [2025-12-13 16:32:46 +0000] [271019] [INFO] Worker exiting (pid: 271019)                                                                                                           
orchestrator-1                            | 2025-12-13T16:32:46.089025928Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 Received 500 Internal Server Error from multistage-diagram-tactile-svg-handler                                                            
orchestrator-1                            | 2025-12-13T16:32:46.089130445Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 Handler "multistage-diagram-tactile-svg-handler" execution failed: SyntaxError: Unexpected token '<', "<html>                             
orchestrator-1                            | 2025-12-13T16:32:46.089138650Z   <"... is not valid JSON                                                                                                                                                          
orchestrator-1                            | 2025-12-13T16:32:46.089141145Z     at JSON.parse (<anonymous>)                                                                                                                                                    
orchestrator-1                            | 2025-12-13T16:32:46.089143199Z     at Response.json (file:///usr/src/app/node_modules/node-fetch/src/body.js:149:15)
orchestrator-1                            | 2025-12-13T16:32:46.089145182Z     at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
orchestrator-1                            | 2025-12-13T16:32:46.089157466Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 timestamp=2025-12-13T16:32:46.089Z label=Handler "multistage-diagram-tactile-svg-handler" execution_time_ms=30396.88ms cpu_time_ms=2.6ms n
ormalized_cpu_usage_percent=0%                                 
orchestrator-1                            | 2025-12-13T16:32:46.089188805Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 Valid response generated.
image-pegasus-cim-mcgill-ca-1             | 2025-12-13T16:32:46.090269001Z 10.122.102.247 - - [13/Dec/2025:16:32:46 +0000] "POST /render HTTP/1.1" 200 257485 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142
.0.0.0 Safari/537.36"                                          
orchestrator-1                            | 2025-12-13T16:32:46.090666560Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 Wrote temporary files to /var/log/IMAGE/8b3ae211-b876-40a6-ad8f-d7d789662f91
orchestrator-1                            | 2025-12-13T16:32:46.090670297Z req=8b3ae211-b876-40a6-ad8f-d7d789662f91 TotalRequestExecutionTime execution_time_ms=43464.19ms
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.115461659Z [2025-12-13 16:32:46 +0000] [271076] [INFO] Booting worker with pid: 271076
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.330926321Z INFO:root:Environment Pegasus: PII logging is disabled.
multistage-diagram-tactile-svg-handler-1  | 2025-12-13T16:32:46.334763544Z DEBUG:root:Suppressed verbose logging for OpenAI client libraries
monarch-link-app-1                        | 2025-12-13T16:32:46.552253794Z [2025-12-13 16:32:46 +0000] [99660] [DEBUG] GET /display/766323
monarch-link-app-1                        | 2025-12-13T16:32:46.552393718Z DEBUG:root:Display request received
monarch-link-app-1                        | 2025-12-13T16:32:46.554740452Z DEBUG:root:Sending tactile response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions