/// <summary> /// Try to diagnose whether there's a CLR mismatch error. /// </summary> /// <returns>True if this is the problem.</returns> protected bool CLRStartupProblems() { IClusterResidentObject stdout = this.Job.ClusterConfiguration.ProcessStdoutFile(this.Vertex.ProcessIdentifier, this.Vertex.VertexIsCompleted, this.Vertex.Machine, this.Job.Summary); if (stdout.Exception != null) { return(false); } ISharedStreamReader sr = stdout.GetStream(); // only look for the error in the first 10 lines for (int i = 0; i < 10; i++) { if (sr.EndOfStream) { sr.Close(); return(false); } string line = sr.ReadLine(); if (line.Contains("Error code 2148734720 (0x80131700)")) { this.Log(DiagnosisMessage.Importance.Final, "Error found in vertex stdout:", line); sr.Close(); return(true); } } sr.Close(); return(false); }
/// <summary> /// The stack trace of the vertex at the time of the crash. /// </summary> /// <returns>The stack trace or an empty collection.</returns> public virtual IEnumerable <string> StackTrace() { IClusterResidentObject logdir = this.Job.ClusterConfiguration.ProcessWorkDirectory(this.Vertex.ProcessIdentifier, this.Vertex.VertexIsCompleted, this.Vertex.Machine, this.Job.Summary); IClusterResidentObject stackTrace = logdir.GetFile(this.stackTraceFile); ISharedStreamReader sr = stackTrace.GetStream(); if (sr.Exception == null) { while (!sr.EndOfStream) { yield return(sr.ReadLine()); } } else { yield break; } }
/// <summary> /// Discover whether the failure is caused by the inability to parse the XML plan. /// </summary> /// <returns>The decision.</returns> public Decision XmlPlanParseError() { if (this.jobManager == null) { this.Log(DiagnosisMessage.Importance.Tracing, "Could not find job manager vertex information", ""); return(Decision.Dontknow); } IClusterResidentObject jmstdout = this.jobManager.StdoutFile; if (jmstdout.Exception != null) { this.Log(DiagnosisMessage.Importance.Tracing, "Could not find job manager standard output", ""); return(Decision.Dontknow); } ISharedStreamReader sr = jmstdout.GetStream(); if (sr.Exception != null) { this.Log(DiagnosisMessage.Importance.Tracing, "Could not read job manager standard output", sr.Exception.Message); return(Decision.Dontknow); } string firstline = sr.ReadLine(); if (sr.EndOfStream || firstline == null) { sr.Close(); return(Decision.No); } sr.Close(); if (firstline.Contains("Error parsing input XML file")) { this.Log(DiagnosisMessage.Importance.Final, "The job manager cannot parse the XML plan file.\n", "This means probably that the version of LinqToDryad.dll that you are using does not match the XmlExecHost.exe file from your drop."); return(Decision.Yes); } return(Decision.No); }
/// <summary> /// Detect whether vertex terminates with a stack overflow. /// </summary> /// <returns>True if this seems likely.</returns> protected virtual Decision StackOverflow() { IClusterResidentObject stdout = this.Job.ClusterConfiguration.ProcessStdoutFile(this.Vertex.ProcessIdentifier, this.Vertex.VertexIsCompleted, this.Vertex.Machine, this.Job.Summary); if (stdout.Exception != null) { return(Decision.Dontknow); } ISharedStreamReader sr = stdout.GetStream(); while (!sr.EndOfStream) { string line = sr.ReadLine(); if (line.Contains("StackOverflowException")) { this.Log(DiagnosisMessage.Importance.Final, "Error found in vertex stderr:", line); sr.Close(); return(Decision.Yes); } } sr.Close(); return(Decision.Dontknow); }
/// <summary> /// Load a specified file. /// </summary> /// <param name="file">File to load.</param> public void LoadFile(IClusterResidentObject file) { string filename = file.Name; bool text = true; string basefilename = Path.GetFileName(filename); if (basefilename != null && (basefilename.EndsWith(".log") && basefilename.StartsWith("cosmos"))) { text = false; } long len = file.Size; this.Initialize(text, basefilename); //ISharedStreamReader sr = new FileSharedStreamReader(filename); ISharedStreamReader sr = file.GetStream(false); long lineno = 0; long bytes = 0; List <TextFileLine> toAddText = new List <TextFileLine>(); List <PositionedDryadLogEntry> toAddLog = new List <PositionedDryadLogEntry>(); while (!sr.EndOfStream) { string line = sr.ReadLine(); bytes += line.Length; if (this.shownText != null) { toAddText.Add(new TextFileLine(lineno, line)); } else { PositionedDryadLogEntry cle = new PositionedDryadLogEntry(filename, lineno, line); if (cle.Malformed) { Trace.TraceInformation("Malformed log entry: " + cle.OriginalLogLine); } else { toAddLog.Add(cle); } } if (lineno++ % 100 == 0 && len > 0) { this.UpdateProgress((int)(bytes * 100 / len)); } } if (this.shownText != null) { this.shownText.SetItems(toAddText); } else { this.shownLogLines.SetItems(toAddLog); } this.Status("Loaded " + lineno + " lines.", StatusKind.OK); this.UpdateProgress(100); sr.Close(); this.filteredDataGridView.DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCellsExceptHeader); }
/// <summary> /// Parse a part of the 'originalInfo.txt' file to discover a set of channel endpoints. /// </summary> /// <param name="sr">Stream reader which contains the channel information.</param> /// <returns>The list of channels, or null on failure.</returns> /// <param name="uriprefix">If the channel is an output, prefix the path with this; this is null for inputs.</param> /// <param name="skip">If true, do not return anything (still useful to advance the stream reader).</param> /// <param name="fast">If true the channel sizes are not discovered; this is much faster, since no remote machines are queried for files.</param> /// <param name="manager">Communication manager.</param> private Dictionary<int, ChannelEndpointDescription> DiscoverOriginalInfoChannels(ISharedStreamReader sr, string uriprefix, bool skip, bool fast, CommManager manager) { bool isInput = uriprefix == null; string countline = sr.ReadLine(); if (countline == null) return null; int channelCount; int spaceIndex = countline.IndexOf(' '); if (spaceIndex > 0) countline = countline.Substring(0, spaceIndex); bool success = int.TryParse(countline, out channelCount); if (!success) return null; var channels = new Dictionary<int, ChannelEndpointDescription>(channelCount); for (int i = 0; i < channelCount; i++) { string channel = sr.ReadLine(); if (channel == null) { manager.Progress(100); return null; } if (!skip) { ChannelEndpointDescription desc = new ChannelEndpointDescription(isInput, i, channel, uriprefix, fast, manager.Status); channels.Add(i, desc); manager.Progress(i * 100 / channelCount); } } manager.Progress(100); if (skip) return null; return channels; }