Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-70531] Apply timeout on WebSocket write operations #7596

Merged
merged 7 commits into from Feb 5, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Jan 20, 2023

Matches jenkinsci/remoting#621. https://issues.jenkins.io/browse/JENKINS-70531

Testing done

See upstream.

Proposed changelog entries

  • Allow WebSocket agent connections to time out after 5m if a write never succeeds.

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

// As in Engine.runWebSocket:
LOGGER.finest(() -> "sending message of length " + (headerAndData.remaining() - 2));
try {
sendBinary(headerAndData).get(5, TimeUnit.MINUTES);
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that any channel write operation should be under 5 minutes?

I know it's a bad practice, but what if a plugin is copying big files from the agent to the controller, that could easily take more than 5 minutes.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean if you are using archiveArtifacts without artifact-manager-s3. Yes that could easily run over 5m for one copy operation; but this timeout is for one transport frame, which is currently only 8k (for WebSocket it could probably be increased considerably). Even one Command (broken into frames) would not necessarily be the full file size, since you would be using a RemoteOutputStream sending ProxyOutputStream.Chunks which default to 1Mb. (all IIUC, but certainly worth testing)

@jglick jglick changed the title Apply timeout on WebSocket write operations [JENKINS-70531] Apply timeout on WebSocket write operations Feb 1, 2023
@car-roll
Copy link
Contributor

car-roll commented Feb 2, 2023

@jglick i know this is still in draft, but I was wondering, would this PR be considered for lts-backport?

@jglick
Copy link
Member Author

jglick commented Feb 2, 2023

Perhaps. I added lts-candidate to JENKINS-70531.

@MarkEWaite MarkEWaite added bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback labels Feb 4, 2023
@MarkEWaite
Copy link
Contributor

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

@MarkEWaite MarkEWaite self-assigned this Feb 4, 2023
@MarkEWaite MarkEWaite merged commit e0aee59 into jenkinsci:master Feb 5, 2023
@jglick jglick deleted the write-timeout branch February 6, 2023 13:43
NotMyFault pushed a commit to NotMyFault/jenkins that referenced this pull request Feb 10, 2023
…i#7596)

* Apply timeout on WebSocket write operations
* jenkinsci/remoting#621 released

(cherry picked from commit e0aee59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
4 participants