Skip to content

Conversation

@nick-galluzzo
Copy link
Collaborator

@nick-galluzzo nick-galluzzo commented Jul 12, 2025

This PR addresses the recurring timeout error where processing larger documents fails after 30 seconds. The error mcp.shared.exceptions.McpError: Timed out while waiting for response to ClientRequest occurs during the extract_file_data step because the server-side processing takes longer than the client's default timeout.


Before:

Screenshot 2025-07-12 at 11 19 51 AM

After:

Screenshot 2025-07-12 at 11 22 05 AM

The Fix

This is a quick-fix that increases the timeout for the BasicMCPClient from 30 seconds to 120 seconds. This provides a more generous and stable window for the server to complete its work, preventing the premature timeout and improving the user experience.

Future Work

While this hot fix immediately resolves the issue for users, a more robust long-term solution can still be explored. Potential improvements include:

  • Implementing an asynchronous polling mechanism where the client submits a processing job and checks for the result periodically.
  • Optimizing the backend extract_file_data workflow to reduce processing time.

I'll start working on this, but in the meantime, this hot-fix should resolve our current issues.

Related Issues

The `extract_file_data` step was timing out after 30 seconds when processing larger or more complex files, causing an McpError.
This change increases the BasicMCPClient timeout to 120 seconds, providing a more stable window for the server to complete its work
Copy link
Member

@AstraBert AstraBert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @nick-galluzzo , thanks a lot for the contribution!
I'm gonna merge this and then, when you bump the version in the other PR, I'll make the 0.3.1 release!

@AstraBert AstraBert merged commit 9c92a44 into run-llama:main Jul 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REPORT] Error processing document: Error in step 'extract_file_data': unhandled errors in a TaskGroup (1 sub-exception)

2 participants