On 20.11.2018 08:29, Daniel Shahaf wrote:
> Dmitry Pavlenko wrote on Mon, Nov 19, 2018 at 17:05:16 +0300:
>> Hello Subversion community!
>> I've run into an error: when performing 2 specially constructed updates one after another
>> within the same session, SVN fails with
>>
>> $ ./ra-test 15
>> svn_tests: E160016: Can't get entries of non-directory
>> XFAIL: ra-test 15: check that there's no "Can't get entries" error
>>
> That error code is SVN_ERR_FS_NOT_DIRECTORY.
>
>> error. I believe these updates constructed that way are valid, so the problem is
>> somewhere in FSFS code. It's also interesting that if these updates are run
>> separately (e.g. by adding "if (FALSE)" to one or another), they succeed.
>>
> Could you please clarify whether the bug reproduces under other backends (FSX and BDB)?
>
>> +++ subversion/tests/libsvn_ra/ra-test.c (working copy)
>> @@ -1784,7 +1784,113 @@ commit_locked_file(const svn_test_opts_t *opts, ap
>> +cant_get_entries_of_non_directory(const svn_test_opts_t *opts, apr_pool_t *pool)
>> +{
>> + svn_ra_session_t *session;
>> + const svn_delta_editor_t *editor;
>> + void *edit_baton;
>> + const svn_ra_reporter3_t *reporter;
>> + void *report_baton;
>>
>> + SVN_ERR(make_and_open_repos(&session,
>> + "cant_get_entries_of_non_directory", opts,
>> + pool));
>> +
>> + {
>> + SVN_ERR(svn_ra_get_commit_editor3(session, &editor, &edit_baton,
>> + apr_hash_make(pool), NULL,
>> + NULL, NULL, FALSE, pool));
>> +
>> + SVN_ERR(editor->open_root(edit_baton, 0, pool, &root_baton));
>> + }
> You make all commits using the same EDITOR. Is that allowed? Should
> you make the 'editor' variable block-scoped and call svn_ra_get_commit_editor3()
> anew in each block?
As far as I know, using the editor after close_edit() or abort_edit()
have been called is a bad idea. This isn't explicitly spelled out in our
API docs, but none of our code or tests tries to reuse the editor. IIUC,
the only editor function you can call after close_edit() is abort_edit()
— which is a no-op if close_edit() succeeds.
The Ev2 documentation is a bit more explicit about that.
-- Brane
Received on 2018-11-20 08:41:43 CET