5

我刚刚尝试使用单声道从 linux 连接到我的 RavenDB Windows 实例。我遇到了一个奇怪的错误,这似乎与单声道有关,而不是与乌鸦有关。

这是我的重新创建代码(适用于 Windows):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Document;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {

            try
            {
                var store = new DocumentStore()
                                {
                                    ConnectionStringName = "RavenDB",
                                    EnlistInDistributedTransactions = false

                                };
                store.Initialize();

                using (var session = store.OpenSession("system-events"))
                {
                    session.Store(new { Name = "Test" });
                    session.SaveChanges();
                }
                Console.WriteLine("done");
            }
            catch (Exception ex)
            {

                Console.WriteLine(ex.ToString());
            }

            Console.ReadKey();


        }
    }
}

和我的单声道版本:

chris@x-ngx4:~/click/beta/Debug$ mono --version
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

和错误:

chris@x-ngx4:~/click/beta/Debug$ mono ConsoleApplication2.exe
System.IO.IOException: Internal error (no progress possible) Flush
  at System.IO.Compression.DeflateStream.CheckResult (Int32 result, System.String where) [0x00000] in <filename unknown>:0
  at System.IO.Compression.DeflateStream.Flush () [0x00000] in <filename unknown>:0
  at System.IO.Compression.GZipStream.Flush () [0x00000] in <filename unknown>:0
  at Raven.Abstractions.Connection.HttpRequestHelper.WriteDataToRequest (System.Net.HttpWebRequest req, System.String data, Boolean disableCompression) [0x00000] in <filename unknown>:0
  at Raven.Client.Connection.HttpJsonRequest.Write (System.String data) [0x00000] in <filename unknown>:0
  at Raven.Client.Connection.ServerClient.DirectBatch (IEnumerable`1 commandDatas, System.String operationUrl) [0x00000] in <filename unknown>:0
  at Raven.Client.Connection.ServerClient+<>c__DisplayClass68.<Batch>b__67 (System.String u) [0x00000] in <filename unknown>:0
  at Raven.Client.Connection.ReplicationInformer.TryOperation[BatchResult[]] (System.Func`2 operation, System.String operationUrl, Boolean avoidThrowing, Raven.Abstractions.Data.BatchResult[]& result) [0x00000] in <filename unknown>:0
4

1 回答 1

6

我想我找到了。 DeflateStream具有对 zlib 的外部引用。如果你查看zlib 头文件,你会发现一些注释:

deflate() 如果取得了一些进展(处理更多输入或产生更多输出),则返回 Z_OK,如果已消耗所有输入并产生所有输出,则返回 Z_STREAM_END(仅当将 flush 设置为 Z_FINISH 时),如果流状态为 Z_STREAM_ERROR不一致(例如,如果 next_in 或 next_out 为 Z_NULL),如果无法取得进展,则为 Z_BUF_ERROR(例如,avail_in 或avail_out 为零)。 请注意,Z_BUF_ERROR 不是致命的,并且可以再次调用 deflate() 并使用更多输入和更多输出空间来继续压缩。

该消息Internal error (no progress possible)DeflateStream在获得时返回的内容Z_BUF_ERROR- 但它不会继续,它将其视为硬停止。它应该将其视为警告并继续。至少,这是我的解释。

你能向单声道支持团队提出这个问题吗?我在那个组里不活跃。谢谢。

于 2012-12-13T19:24:51.193 回答