diff --git a/modules/big-dig/src/services/fs/experimental/fuse/src/MountedFileSystem.js b/modules/big-dig/src/services/fs/experimental/fuse/src/MountedFileSystem.js index 2b3f3f7581..0752ba090e 100644 --- a/modules/big-dig/src/services/fs/experimental/fuse/src/MountedFileSystem.js +++ b/modules/big-dig/src/services/fs/experimental/fuse/src/MountedFileSystem.js @@ -17,7 +17,7 @@ import fuse from 'fuse-bindings'; import thrift from 'thrift'; import LRU from 'lru-cache'; -import RemoteFileSystemService from '../../../gen-nodejs/RemoteFileSystemService'; +import ThriftFileSystemService from '../../../gen-nodejs/ThriftFileSystemService'; export class MountedFileSystem { _root: string; @@ -209,7 +209,7 @@ export class MountedFileSystem { transport: thrift.TBufferedTransport(), protocol: thrift.TBinaryProtocol(), }); - const client = thrift.createClient(RemoteFileSystemService, connection); + const client = thrift.createClient(ThriftFileSystemService, connection); return Promise.resolve( new MountedFileSystem(root, mountPath, client, connection), ); diff --git a/modules/big-dig/src/services/thrift/__tests__/createThriftServer-test.js b/modules/big-dig/src/services/thrift/__tests__/createThriftServer-test.js index 097704c64b..847785b615 100644 --- a/modules/big-dig/src/services/thrift/__tests__/createThriftServer-test.js +++ b/modules/big-dig/src/services/thrift/__tests__/createThriftServer-test.js @@ -16,13 +16,13 @@ import {createThriftServer} from '../createThriftServer'; import thrift from 'thrift'; import * as portHelper from '../../../common/ports'; -const RemoteFileSystemServiceHandler = jest.fn(function(root, watchman) { +const ThriftFileSystemServiceHandler = jest.fn(function(root, watchman) { this._watcher = watchman; }); const mockPort = 9090; jest.mock(require.resolve('../../fs/ThriftFileSystemServiceHandler'), () => ({ - RemoteFileSystemServiceHandler, + ThriftFileSystemServiceHandler, })); jest diff --git a/pkg/nuclide-remote-connection/lib/ServerConnection.js b/pkg/nuclide-remote-connection/lib/ServerConnection.js index b41608127e..8e53ecba49 100644 --- a/pkg/nuclide-remote-connection/lib/ServerConnection.js +++ b/pkg/nuclide-remote-connection/lib/ServerConnection.js @@ -60,6 +60,7 @@ import { import electron from 'electron'; const logger = getLogger('nuclide-remote-connection'); +const thriftRfsLogger = getLogger('thrift-rfs-server-connection'); const remote = electron.remote; const ipc = electron.ipcRenderer; const THRIFT_RFS_GK = 'nuclide_thrift_rfs'; @@ -571,7 +572,6 @@ export class ServerConnection { return this._makeThriftRfsCall(propKey, args); }; } - logger.error('Using legacy rfs for method: ', propKey); return target[propKey]; }, }; @@ -585,12 +585,20 @@ export class ServerConnection { return trackTimingSampled( `file-system-service:${fsOperation}`, async () => { - const thriftRfsClient = await getOrCreateRfsClientAdapter( - this.getBigDigClient(), - ); - // $FlowFixMe: suppress 'indexer property is missing warning' - const method = thriftRfsClient[fsOperation]; - return method.apply(thriftRfsClient, args); + try { + const thriftRfsClient = await getOrCreateRfsClientAdapter( + this.getBigDigClient(), + ); + // $FlowFixMe: suppress 'indexer property is missing warning' + const method = thriftRfsClient[fsOperation]; + return await method.apply(thriftRfsClient, args); + } catch (e) { + thriftRfsLogger.error( + `failed to run method ${fsOperation} from Thrift client`, + e, + ); + throw e; + } }, FILE_SYSTEM_PERFORMANCE_SAMPLE_RATE, {serviceProvider: 'thrift'},