Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Exception RequestGenerationFailed in HTTPClientService with debug=True #8757

@slydiman

Description

@slydiman

We tried to use the property debug in classes inherited from GitHubStatusPush for a simulation mode.
And we faced a side effect - GitHubStatusPush and other classes used HTTPClientService may raise an exception on high load if debug=True

reporters.GitHubStatusPush(debug=True, token=MY_TOKEN, ...)
2026-01-27 10:46:43+0000 [-] Updating github status: repo_owner=llvm, repo_name=llvm-project
2026-01-27 10:46:43+0000 [-] Failed to update "success" for llvm/llvm-project at ***, context "***", issue None. http n/a, n/a
	Traceback (most recent call last):
	  File "/home/llvm-buildbot/.local/lib/python3.10/site-packages/twisted/internet/defer.py", line 1857, in _cancellableInlineCallbacks
	    _inlineCallbacks(None, gen, status, _copy_context())
	  File "/home/llvm-buildbot/.local/lib/python3.10/site-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
	    result = context.run(
	  File "/home/llvm-buildbot/.local/lib/python3.10/site-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
	    return g.throw(self.type, self.value, self.tb)
	  File "/home/llvm-buildbot/buildbot/master/buildbot/reporters/github.py", line 234, in sendMessage
	    log.err(
	--- <exception caught here> ---
	  File "/home/llvm-buildbot/buildbot/master/buildbot/reporters/github.py", line 208, in sendMessage
	    response = yield self.createStatus(repo_user=repo_owner,
	twisted.web._newclient.RequestGenerationFailed: [<twisted.python.failure.Failure builtins.AttributeError: 'FileBodyProducer' object has no attribute '_task'>]

It is possible if FileBodyProducer.pauseProducing(), FileBodyProducer.resumeProducing() or FileBodyProducer.stopProducing() has been called before FileBodyProducer.startProducing(consumer) where _task is defined.

Note sometimes we got the same exception in GitHubStatusPush on high load even with debug=False but GitHubCommentPush works fine. The only difference is

class GitHubStatusPush(ReporterBase):
...
    def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None):
        ...
        return self._http.post('/'.join(['/repos', repo_user, repo_name, 'statuses', sha]), json=payload)

vs

class GitHubCommentPush(GitHubStatusPush):
...
    @defer.inlineCallbacks
    def createStatus(self, repo_user, repo_name, sha, state, target_url=None, context=None, issue=None, description=None):
        ...
        ret = yield self._http.post(url, json=payload)
        return ret

So probably it is necessary to add @defer.inlineCallbacks and yield to GitHubStatusPush.createStatus too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions