GeezerVison is showing github.com — document.clone().append(html) is not threadsafe · Issue #2281 · jhy/jsoup
document.clone().append(html) is not threadsafe #2281
Labels
bugA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented} Description
If multiple threads try to call document.clone().append(html), they will fail.
.append(html) uses the document's parser, and that is not being cloned along with the document. And so multiple threads are hitting the same parser, which is not thread safe.
This is the root cause of #2280
Activity
added a commit that references this issue
on Mar 2, 2025This issue will close once commit d55469a is merged into the 'master' branch.d55469a jhy commented on Apr 28, 2025
I changed this in #2314 so that the Parser itself is threadsafe, and in #2315 so that we don't create Parser clones or new instances on every Document.clone or Element.clone.
Metadata
Metadata
bugA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented} Development
No branches or pull requestsIssue actions