Giter Site home page Giter Site logo

Comments (14)

okbob avatar okbob commented on August 15, 2024

from pspg.

sasha-alias avatar sasha-alias commented on August 15, 2024

Yeah, it's MacOS.

$pspg --info
pspg-5.8.1
with readline (version: 0x0802)
with integrated menu
ncurses version: 6.4, patch: 20221231
ncurses with wide char support
ncurses widechar num: 0
wchar_t width: 4, max: 2147483647
with ncurses extended functions support no: 20221231
without ncurses extended colors
with postgres client integration
without inotify support
with kqueue support
Darwin MacBookPro18 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64
$ pspg test.txt --log=log.log
No data
$ cat log.log
Thu, 01 Feb 2024 18:57:49 +0100 [59149] started
Thu, 01 Feb 2024 18:57:49 +0100 [59149] with utf8 support
Thu, 01 Feb 2024 18:57:49 +0100 [59149] esc delay = -1
Thu, 01 Feb 2024 18:57:49 +0100 [59149] DataDesc is initialized
Thu, 01 Feb 2024 18:57:49 +0100 [59149] sleep 10ms per 1000 rows
Thu, 01 Feb 2024 18:57:49 +0100 [59149] cannot to read from file (Operation timed out)
Thu, 01 Feb 2024 18:57:49 +0100 [59149] xterm mouse mode 1002 is not active
Thu, 01 Feb 2024 18:57:49 +0100 [59149] No data

Let me know if I can help somehow with debugging it.

PS
--no-progressive-load doesn't help (

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

sasha-alias avatar sasha-alias commented on August 15, 2024

This line

			log_row("sleep 10ms per 1000 rows");
			usleep(1000 * 10);

For some reason the usleep causes the timeout. If I remove the usleep everything works fine.
Not sure what would be a proper fix though. Any ideas?

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

if you can, try to debug _getline function, you can compare it with linux.

from pspg.

sasha-alias avatar sasha-alias commented on August 15, 2024

I added the following log straight after the _getline:

		read = _getline(&line, &len, f_data, f_data_opts & STREAM_IS_IN_NONBLOCKING_MODE, true);
		log_row("errno: %d, read: %zu", errno, read);

and got this:

...
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 0, read: 6
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 0, read: 6
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 0, read: 6
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 60, read: 6
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 60, read: 6
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 60, read: 12
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 60, read: 1
Sat, 03 Feb 2024 10:41:55 +0100 [10422] errno: 60, read: 18446744073709551615
Sat, 03 Feb 2024 10:41:55 +0100 [10422] cannot to read from file (Operation timed out)
Sat, 03 Feb 2024 10:41:55 +0100 [10422] xterm mouse mode 1002 is not active
Sat, 03 Feb 2024 10:41:55 +0100 [10422] No data

I.e. at some point the errno starts to report 60 (ETIMEDOUT).
The file is read to the end though. But this code then exits because of the errno:

	if (errno && errno != EAGAIN)
	{
		log_row("cannot to read from file (%s)", strerror(errno));

		return false;
	}

If I ignore the ETIMEDOUT then things look working. If I remove usleep, then there is no ETIMEDOUT generated.
Not sure, maybe it's a Mac M1 chip specifics.

PS
kqueue looks empty after usleep.

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

from pspg.

okbob avatar okbob commented on August 15, 2024

I cannot to reproduce it.

from pspg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.