-
Notifications
You must be signed in to change notification settings - Fork 467
Bugfix/create server resources on function creation #657
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
Bugfix/create server resources on function creation #657
Conversation
…ds to be recreated if it is ever used again.
You're a genius! This was a classic "use after free" style of bug, with an easy one-line fix. The bug was for all "FormatterFunc.Closeable", but the npm steps are the only ones that use that functionality. Next up is a test which shows that it is fixed. |
Part of this is also the I updated the changelogs, this looks fixed to me. I'll let you decide if you want to do anything else (maybe silence the logging?) and then you can press merge. |
…r-resources-on-function-creation # Conflicts: # plugin-gradle/CHANGES.md
lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java
Outdated
Show resolved
Hide resolved
Awesome, thank you for cleaning everything up. 👍 |
This the pull request ultimately intended to be fixing #651
The expected problem of "writing to the build dir on step creation" does not appear to be the problem. It seems to me that it is a lifecycle issue.
I've added some debug logging and this results in the following output for my integration test reproducing this issue:
It shows that the server is started at the beginning of
spotlessMytypescript
and ended/closed at the end ofspotlessMytypescript
again. But thenspotlessMytypescriptCheck
is triggered (which does not prepare a new server instance) but tries to format using the "old" formatting function used inspotlessMytypescript
(which has already been closed).Is this a problem that my step is considered "still ready" although it isn't or is this a problem of "closing formatting function too early"?