Skip to content

Restart waitpid call if we get interrupted.#409

Merged
Leonidas-from-XIV merged 1 commit intorealworldocaml:mainfrom
tmcgilchrist:waitpid
Dec 7, 2022
Merged

Restart waitpid call if we get interrupted.#409
Leonidas-from-XIV merged 1 commit intorealworldocaml:mainfrom
tmcgilchrist:waitpid

Conversation

@tmcgilchrist
Copy link
Copy Markdown
Contributor

Where [EINTR] means the call is interrupted by a caught signal or the signal does not have the SA_RESTART flag set.

This error was thrown when running an mdx test for ocurrent/ocurrent:

$ (cd _build/default/plugins/git/test && /Users/user/.opam/ocurrent/bin/ocaml-mdx test -o .mdx/test_submodules.md.corrected test_submodules.md) > _build/default/plugins/git/test/.mdx/test_submodules.md.corrected
ocaml-mdx-test: internal error, uncaught exception:
        Unix.Unix_error(Unix.EINTR, "waitpid", "")

Based off a suggestion by @talex5 and this OCaml unix library code https://github.com/ocaml/ocaml/blob/trunk/otherlibs/unix/unix_unix.ml#L869-L871

@Leonidas-from-XIV
Copy link
Copy Markdown
Collaborator

@tmcgilchrist Looks good, thanks for the contribution. If you add an entry to the changelog and reformat it should be ready to merge.

@tmcgilchrist tmcgilchrist marked this pull request as ready for review December 7, 2022 22:35
Where [EINTR] means the call is interrupted by a caught signal or the
signal does not have the SA_RESTART flag set.
Copy link
Copy Markdown
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, ready to merge!

@Leonidas-from-XIV Leonidas-from-XIV merged commit 0d20ffe into realworldocaml:main Dec 7, 2022
@tmcgilchrist tmcgilchrist deleted the waitpid branch December 7, 2022 23:04
@tmcgilchrist
Copy link
Copy Markdown
Contributor Author

Thanks @Leonidas-from-XIV. Is it possible to get an opam release with this fix included?

@Leonidas-from-XIV
Copy link
Copy Markdown
Collaborator

Leonidas-from-XIV commented Dec 12, 2022

@tmcgilchrist I'll try to cut a release (2.2.0) when #397 is merged which should be hopefully this week.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this pull request Jan 6, 2023
CHANGES:

#### Added

- Report all parsing errors in Markdown files (realworldocaml/mdx#389, @NathanReb)

#### Changed

- Preserve indentation in multiline OCaml blocks in .mli files (realworldocaml/mdx#395, @panglesd)

#### Fixed

- Fixed compatibility with Cmdliner 1.1.0 (realworldocaml/mdx#371, @Leonidas-from-XIV)
- Report errors and exit codes of toplevel directives (realworldocaml/mdx#382, @talex5,
  @Leonidas-from-XIV)
- Fix block locations in error reporting (realworldocaml/mdx#389, @NathanReb)
- Include the content of the line that features the `part-end` MDX directive in
  the output, before that line would've been dropped (realworldocaml/mdx#374, realworldocaml/mdx#387,
  @Leonidas-from-XIV)
- Handle EINTR signal on waitpid call by restarting the syscall. (realworldocaml/mdx#409, @tmcgilchrist)
- Fix parsing of multiline toplevel phrases in .mli files (realworldocaml/mdx#394, realworldocaml/mdx#397,
  @Leonidas-from-XIV)

#### Removed

- Removed warning about missing semicolons added in MDX 1.11.0 and the
  automatic insertion of semicolons in the corrected files introduced in MDX
  2.0.0. (realworldocaml/mdx#398, @Leonidas-from-XIV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants