Github user zsxwing commented on the pull request:
https://github.com/apache/spark/pull/8357#issuecomment-133793646
> Does DDLParser have the same issue?
I think we only create one `DDLParser` in on SQLContext. Right? It does
still leak one `ThreadLocal`, but I don't think people will create a lot of
`SQLContext`. If so, I think we should change all subclasses of
`scala.util.parsing.combinator.Parsers` in SQL to object.
> since SI-4929's resolution is "out of scope", can you add a pointer of
the comment saying parser combinator is thread safe in the description?
`SI-4929` was set to `out of scope` because this comment here
https://issues.scala-lang.org/browse/SI-4929?focusedCommentId=72968&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-72968
:
```
The parser combinators library is now community-maintained. Issues with it
are now tracked at https://github.com/scala/scala-parser-combinators/issues/61
instead of here in the Scala JIRA.
Interested community members: if you consider this issue significant, feel
free to open a new issue for it on GitHub, with links in both directions.
```
SI-4929 is really confusing because a lot of comments are about the memory
leak rather that the original thread-safe issue.
`scala.util.parsing.combinator.Parsers` has only one field
`lastNoSuccessVar`, which is `DynamicVariable` now. Of cause,
`scala.util.parsing.combinator.Parsers.Parser` is not thread-safe, but it's
created every time when parsing input, so that's safe.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]