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

Optimize file system access when in ZIP mode #2230

Closed
paulbatum opened this issue Dec 15, 2017 · 1 comment
Closed

Optimize file system access when in ZIP mode #2230

paulbatum opened this issue Dec 15, 2017 · 1 comment
Milestone

Comments

@paulbatum
Copy link
Member

paulbatum commented Dec 15, 2017

Run-From-Zip feature: Azure/app-service-announcements#84

If the WEBSITE_USE_ZIP environment variable is set, we need to avoid unnecessary file system access. For example, do not attempt to perform any write operations to the contents of wwwroot, as these will fail. Looks like we do this for hostingstart.html and for host.json. See below for an example stacktrace of this.

We need to look carefully at all file access operations and review whether they can be avoided with ZIP enabled.

Write failure stacktrace:

System.UnauthorizedAccessException : Access to the path 'D:\home\site\wwwroot\host.json' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode,String maybeFullPath)
   at System.IO.FileStream.Init(String path,FileMode mode,FileAccess access,Int32 rights,Boolean useRights,FileShare share,Int32 bufferSize,FileOptions options,SECURITY_ATTRIBUTES secAttrs,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)
   at System.IO.FileStream..ctor(String path,FileMode mode,FileAccess access,FileShare share,Int32 bufferSize,FileOptions options,String msgPath,Boolean bFromProxy,Boolean useLongPath,Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path,Boolean append,Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path,Boolean append,Encoding encoding,Int32 bufferSize,Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path,String contents,Encoding encoding,Boolean checkHost)
   at System.IO.File.WriteAllText(String path,String contents)
   at Microsoft.Azure.WebJobs.Script.ScriptHost.Initialize() at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 288
   at Microsoft.Azure.WebJobs.Script.ScriptHost.Create(IScriptHostEnvironment environment,IScriptEventManager eventManager,ScriptHostConfiguration scriptConfig,ScriptSettingsManager settingsManager,ProxyClientExecutor proxyClient) at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Host\ScriptHost.cs : 806
@paulbatum paulbatum added this to the Triaged milestone Dec 15, 2017
@paulbatum paulbatum added the 2.0 label Jan 20, 2018
@paulbatum
Copy link
Member Author

We'll probably only focus on doing zip optimizations for v2, so labelling appropriately.

@paulbatum paulbatum modified the milestones: Triaged, Backlog Jan 20, 2018
@mathewc mathewc modified the milestones: Backlog, Sprint 18 Feb 15, 2018
@mathewc mathewc closed this as completed Feb 15, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants